Working on a C# project that uses Rabbit. I've found what appears to me as conflicting information in the documentation regarding when a message is redelivered as a result of either a connection or channel dying (which one is it?)
The docs here: http://www.rabbitmq.com/semantics.html
State that it is requeued for delivery when a channel closes
Messages can be returned to the queue using AMQP methods that feature a requeue parameter (basic.recover, basic.reject and basic.nack), or due to a channel closing while holding unacknowledged messages. Any of these scenarios caused messages to be requeued at the back of the queue for RabbitMQ releases earlier than 2.7.0. From RabbitMQ release 2.7.0, messages are always held in the queue in publication order, even in the presence of requeueing or channel closure.
But here: http://www.rabbitmq.com/tutorials/tutorial-two-dotnet.html
States: Only when the worker connection dies
If a consumer dies without sending an ack, RabbitMQ will understand that a message wasn't processed fully and will redeliver it to another consumer. That way you can be sure that no message is lost, even if the workers occasionally die.
There aren't any message timeouts; RabbitMQ will redeliver the message only when the worker connection dies. It's fine even if processing a message takes a very, very long time.
So when does redelivery actually happen? When the worker or the channel dies? Can I Consume on one channel but ACK on another channel?
Currently I created a ChannelManager class that opens N channels and stores them in a ConcurrentQueue and Queues / Dequeues Channels as they are needed, and also ensures we never fall below the 'minimum' available channel count. With this method there is no way for me to ensure the Consume and Ack happen on the same channel...