A data structure for retry log entries. These are created when an operation is attempted and cannot be completed, typically
due to an inability to connect to the Linxter ISB. Additional attempts are made in the background until the operation can be completed.
Namespace:
Linxter.Common.EntitiesAssembly: Linxter.Common.Entities (in Linxter.Common.Entities.dll) Version: 1.5.0.0 (1.5.0.0)
Syntax
| C# |
|---|
public class RetryLogEntry |
| Visual Basic (Declaration) |
|---|
Public Class RetryLogEntry |
Examples
public bool CheckConnectivityStatus(ILinxterMessaging messagingObject) { // Use the GetRetryLogEntries to determine whether messages are getting through bool status = true; List<RetryLogEntry> logEntries = messagingObject.GetRetryLogEntries(); if (logEntries.Count > 0) { // If there are messages in a retry state, notify the user and write an event log entry int sendQueueCount = 0; int receiveQueueCount = 0; using (System.Diagnostics.EventLog evt = new System.Diagnostics.EventLog("Application")) { foreach (RetryLogEntry item in logEntries) { if (item.Operation.ToLower().Equals("send")) { sendQueueCount++; } if (item.Operation.ToLower().Equals("receive")) { receiveQueueCount++; } evt.Source = "My Sample Program"; evt.WriteEntry(string.Format("Message in retry state, last retry: {0}\nError info: {1}", item.LogDateTime, item.ErrorInfo), System.Diagnostics.EventLogEntryType.Error, 1003); } } MessageBox.Show("{0} messages are in a send retry cycle.\n{1} messages are in a receive retry cycle."); status = false; } return status; }
Public Function CheckConnectivityStatus(ByVal messagingObject As ILinxterMessaging) As Boolean ' Use the GetRetryLogEntries to determine whether messages are getting through Dim status As Boolean = True Dim logEntries As List(Of RetryLogEntry) = messagingObject.GetRetryLogEntries() If logEntries.Count > 0 Then ' If there are messages in a retry state, notify the user and write an event log entry Dim sendQueueCount As Integer = 0 Dim receiveQueueCount As Integer = 0 Using evt As New System.Diagnostics.EventLog("Application") For Each item As RetryLogEntry In logEntries If item.Operation.ToLower().Equals("send") Then sendQueueCount += 1 End If If item.Operation.ToLower().Equals("receive") Then receiveQueueCount += 1 End If evt.Source = "My Sample Program" evt.WriteEntry(String.Format("Message in retry state, last retry: {0}" & vbLf & "Error info: {1}", item.LogDateTime, item.ErrorInfo), System.Diagnostics.EventLogEntryType.Error, 1003) Next item End Using MessageBox.Show("{0} messages are in a send retry cycle." & vbLf & "{1} messages are in a receive retry cycle.") status = False End If Return status End Function