This method returns a list of retry log entries. These entries allow you to see if there is a retry cycle
in process for a given operation (i.e. Send or Receive). A retry cycle indicates the SDK was unable to
connect to the Linxter ISB, usually due to a lack of connectivity on the client for offline scenarios.
The log entries show when a retry was attempted and what the error message was. When the operation succeeds,
the retry log is cleared for that operation.
Namespace:
Linxter.SDKAssembly: Linxter.SDK (in Linxter.SDK.dll) Version: 1.5.0.0 (1.5.0.0)
Syntax
| C# |
|---|
List<RetryLogEntry> GetRetryLogEntries() |
| Visual Basic (Declaration) |
|---|
Function GetRetryLogEntries As List(Of RetryLogEntry) |
Return Value
A collection of log entries for retry operations.
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