internal void onConnMessageFinished(Conn c, Message msg) { Interlocked.Increment(ref _messagesFinished); }
internal void onConnMessageRequeued(Conn c, Message msg) { Interlocked.Increment(ref _messagesRequeued); }
internal void onConnMessage(Conn c, Message msg) { Interlocked.Decrement(ref _totalRdyCount); Interlocked.Increment(ref _messagesReceived); _incomingMessages.Send(msg); maybeUpdateRDY(c); }
void IConnDelegate.OnMessageRequeued(Conn c, Message m) { onConnMessageRequeued(c, m); }
void IConnDelegate.OnMessageFinished(Conn c, Message m) { onConnMessageFinished(c, m); }
void IConnDelegate.OnMessage(Conn c, Message m) { onConnMessage(c, m); }
private bool shouldFailMessage(Message message, IHandler handler) { if (_config.MaxAttempts > 0 && message.Attempts > _config.MaxAttempts) { log(LogLevel.Warning, string.Format("msg {0} attempted {1} times, giving up", message.Id, message.Attempts)); try { handler.LogFailedMessage(message); } catch (Exception ex) { log(LogLevel.Error, string.Format("LogFailedMessage returned error for msg {0} - {1}", message.Id, ex)); } return true; } return false; }