RequeueMessage() public method

Requeues the message.
public RequeueMessage ( Message message, string queueName, int delayMilliseconds ) : void
message System.Globalization.Message The message.
queueName string The queue name.
delayMilliseconds int Delay in ms.
return void
Ejemplo n.º 1
0
 public void Requeue(Message message, int delayMilliseconds)
 {
     try
     {
         _logger.Value.DebugFormat("RmqMessageConsumer: Re-queueing message {0} with a delay of {1} milliseconds", message.Id, delayMilliseconds);
         EnsureChannel(_queueName);
         var rmqMessagePublisher = new RmqMessagePublisher(Channel, Connection.Exchange.Name);
         rmqMessagePublisher.RequeueMessage(message, _queueName, delayMilliseconds);
         Reject(message, false);
     }
     catch (Exception exception)
     {
         _logger.Value.ErrorException("RmqMessageConsumer: Error re-queueing message {0}", exception, message.Id);
         throw;
     }
 }
Ejemplo n.º 2
0
 public void Requeue(Message message, int delayMilliseconds)
 {
     try
     {
         Logger.DebugFormat("RmqMessageConsumer: Re-queueing message {0} with a delay of {1} milliseconds", message.Id, delayMilliseconds);
         EnsureChannel(_queueName);
         var rmqMessagePublisher = new RmqMessagePublisher(Channel, Configuration.Exchange.Name, Logger);
         rmqMessagePublisher.RequeueMessage(message, _queueName, delayMilliseconds);
         Reject(message, false);
     }
     catch (Exception exception)
     {
         Logger.ErrorException("RmqMessageConsumer: Error re-queueing message {0}", exception, message.Id);
         throw;
     }
 }