[rabbitmq-discuss] Implement guaranteed delivery with ReturnListener and ConfirmListener

ArnavJoshi arnav.joshi at mathworks.com
Mon Jul 14 19:01:39 BST 2014


Hi,

We are trying to prototype guaranteed delivery of messages. RabbitMQ with
basic publishing or mandatory\immediate flags only guarantees routing a
message up to the broker with some asynchronous acknowledgements back to the
publisher. It does not promise a reliable delivery of messages. With
consumer crashes and broker restarts, the messages can be lost specifically
if it is not declared as persistent. 
 
We planned to implement both the ReturnListener and ConfirmListener
interfaces.

a.	To be notified of failed deliveries when basicPublish is called with
“mandatory” flag
b.	To get publisher confirms on whether messages have been consumed
successfully (acks), or whether they are lost/not persisted (nack).

For testing purposes, we are checking for the confirms for messages which
are being written to undeclared/unbound/currently unavailable queues. We
observe that although the ReturnListener method throws a 312 (NO_ROUTE)
error code, the ConfirmListener still calls the ‘handleAck’ method, and not
the ‘handleNack’ method as we would expect.

If this implementation is by design – could you suggest a way in which we
can implement guaranteed delivery, i.e.:

1.	Confirm that the message has not only reached the broker, but has been
processed by one or more queues.
2.	Throw a nack, or generate an exception when the message cannot be routed
and that the message has been persisted to disk
3.	Making blocking calls to our publishes in the ReturnListener
implementation when we are trying to write to such queues?

Follow up question: If a queue process being killed is the only criterion
for ConfirmListener.handleNack being called – shouldn’t an
undeclared/currently unavailable queue result in handleNack being called.
Our suspicion is that the message which cannot be routed to a currently
unavailable queue is handled like an unroutable message, which is confirmed
immediately after basic.return but is also ‘ACK’ed, which seems
counter-intuitive.

Thanks,
Arnav Joshi




--
View this message in context: http://rabbitmq.1065348.n5.nabble.com/Implement-guaranteed-delivery-with-ReturnListener-and-ConfirmListener-tp36795.html
Sent from the RabbitMQ mailing list archive at Nabble.com.


More information about the rabbitmq-discuss mailing list