예제 #1
0
 private void LogMessageHandlingException(ConsumingMessage consumingMessage, Exception exception)
 {
     _logger.Error(string.Format(
                       "Message handling has exception, message info:[messageId:{0}, topic:{1}, queueId:{2}, queueOffset:{3}, createdTime:{4}, storedTime:{5}, consumerGroup:{6}]",
                       consumingMessage.Message.MessageId,
                       consumingMessage.Message.Topic,
                       consumingMessage.Message.QueueId,
                       consumingMessage.Message.QueueOffset,
                       consumingMessage.Message.CreatedTime,
                       consumingMessage.Message.StoredTime,
                       GroupName), exception);
 }
예제 #2
0
 public void RemoveMessage(ConsumingMessage consumingMessage)
 {
     lock (_lockObj)
     {
         if (_messageDict.Remove(consumingMessage.Message.QueueOffset))
         {
             if (!_messageDict.Keys.IsEmpty())
             {
                 _consumedQueueOffset = _messageDict.Keys.First() - 1;
             }
             else
             {
                 _consumedQueueOffset = _maxQueueOffset;
             }
             _messageCount--;
         }
     }
 }
예제 #3
0
 private void RemoveHandledMessage(ConsumingMessage consumedMessage)
 {
     consumedMessage.PullRequest.ProcessQueue.RemoveMessage(consumedMessage);
 }