[rabbitmq-discuss] How to determine if my message was publish successfully

Michael Klishin mklishin at gopivotal.com
Wed Oct 30 20:51:12 GMT 2013

On 31 Oct 2013, at 00:42, cw storm <cwstorm at gmail.com> wrote:

> I want to capture the basic.return information (replyCode, replyText) if my basisPublish fails.  I've set the channel to confirm.select and set mandatory flag to true.  It's my understanding that if an invalid routing key is provided, the message wouldn't route anywhere and the message should return to the client since it fail to route to a queue.  I just don't understand how to implement that in the java code.

Publishing is asynchronous, so is returning of messages to the client.
You need to register a handler for returned messages. This can be used in combination
with publisher confirms, as necessary.

See http://www.rabbitmq.com/api-guide.html, “Handling unroutable messages”.


Software Engineer, Pivotal/RabbitMQ

More information about the rabbitmq-discuss mailing list