rabbitmq/rabbitmq-dotnet-client — pull request #6 by jkff (2011-11-09 12:27:52+00:00)
Title: Added versions of WaitForConfirms and WaitForConfirmsOrDie with timeouts

It makes sense to have timeouting versions of these methods for the following case (which is my use case):

I'm keeping track of all unconfirmed messages so I can requeue them in case RabbitMQ crashes. But I would not like to do so unless really necessary, because this may lead to duplication of messages and duplication of work.

So, when closing a connection, I'm checking if there are unconfirmed messages. If there are, I'm requeueing them in transactions (for example) or doing something else to make sure they aren't lost even if RabbitMQ crashes right after I close my connection.

However waiting for RabbitMQ to confirm all of them may be a little too long for me, and I definitely don't want this wait period to be out of my control. So I better say "I'm ok with waiting for confirms for 3 seconds, but then I'll kill the connection and deal with the remaining unconfirmed messages myself".