c# - Is there a timeout for acking RabbitMQ messages? -


i set timeout after dequeued message automatically nacked.

when dequeue message wait until transfered on socket , other party confirms reception.

do need keep list of timers or can rmq handle automatically?

private void run() {     _rmqconnection = _queueconnectionfactory.createfactory().createconnection();      _rmqreadchannel = _rmqconnection.createmodel();      _rmqreadchannel.queuedeclare(queueidoutgoing(), true, false, false, null);      _rmqreadchannel.basicqos(0, 1, false);     var consumer = new queueingbasicconsumer(_rmqreadchannel);     _rmqreadchannel.basicconsume(queueidoutgoing(), false, consumer);     while (true)     {         if (!_rmqreadchannel.isopen)         {             throw new exception("channel closed");         }         var ea = consumer.queue.dequeue();         string jsondata = encoding.utf8.getstring(ea.body);         if (onoutgoingmessageready != null)         {             onoutgoingmessageready(this, new queuedataeventargs(jsondata, ea.deliverytag));         }         //waiting ack different thread     } } 

rabbitmq not provide sort of timeout mechanism acknowledging messages. discussed in official python tutorial:

there aren't message timeouts; rabbitmq redeliver message when worker connection dies. it's fine if processing message takes very, long time.

section 3.1.8 of amqp 0-9-1 specification describes acknowledgements, , clear can either automatic (the client doesn't have anything, messages acknowledged delivered) or explicit (the client must ack each message or group of messages has processed).

here's past discussion in 2009 confirming case.

so: yes, if need timeout automatically send nacks after interval, have yourself.


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -