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

cw storm cwstorm at gmail.com
Wed Oct 30 20:42:46 GMT 2013


MK,

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.

channel.basicPublish(strExchangeName, strRoutingKey, true,
MessageProperties.PERSISTENT_TEXT_PLAIN, byteMessage);


On Wed, Oct 30, 2013 at 4:02 PM, Michael Klishin <mklishin at gopivotal.com>wrote:

>
> On 30 Oct 2013, at 23:56, cw storm <cwstorm at gmail.com> wrote:
>
> > I'm using the java client libraries from RabbitMQ.  Just wondering if
> it's possible to determine if a message was publish to the queue
> successfully or not after invoking basicPublish.  If so, can you please
> share example code how this is accomplish?
>
> http://www.rabbitmq.com/confirms.html
>
> http://hg.rabbitmq.com/rabbitmq-java-client/file/default/test/src/com/rabbitmq/examples/ConfirmDontLoseMessages.java
>
> (TL;DR: com.rabbitmq.client.Channel#waitForConfirms)
>
> Note that
>
> 1. You want confirm batches (of 16, 32, 64 messages) if possible
> 2. Even with batch confirmation, Publisher Confirms have significant
> impact on publishing throughput
>
> MK
>
> Software Engineer, Pivotal/RabbitMQ
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20131030/af235c2a/attachment.htm>


More information about the rabbitmq-discuss mailing list