You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Anirudha Khanna <an...@yahoo-inc.com> on 2011/01/11 20:51:14 UTC

asyncSend for producers in persistent mode

Hi,

When sending messages using persistent mode and useAsyncSend=true, I noticed that the producer throughput is roughly 10x more as compared to when useAsyncSend=false. What I am trying to understand is whether it is safe to use this option if we want to guarantee that all the messages that a producer sends will be received by the broker. (using TCP as transport) Are there any caveats to using this option? Will the broker be able to notify the client say if it was unable to persist the message(s) to the message store?

Thanks,
Anirudha

Re: asyncSend for producers in persistent mode

Posted by Dejan Bosanac <de...@nighttale.net>.
Hi,

async send is that much faster for the exact reason it doesn't wait
for the response from the broker before sending the next message. You
can still get exceptions, by using ExceptionListener, but you'll lose
guarantees that message is stored in the broker once your send()
method return.

Regards
--
Dejan Bosanac
-----------------
FuseSource - The experts in open source integration and messaging.
Email: dejanb@fusesource.com
Web: http://fusesource.com
Twitter:  http://twitter.com/dejanb
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net



On Tue, Jan 11, 2011 at 8:51 PM, Anirudha Khanna <an...@yahoo-inc.com> wrote:
> Hi,
>
> When sending messages using persistent mode and useAsyncSend=true, I noticed that the producer throughput is roughly 10x more as compared to when useAsyncSend=false. What I am trying to understand is whether it is safe to use this option if we want to guarantee that all the messages that a producer sends will be received by the broker. (using TCP as transport) Are there any caveats to using this option? Will the broker be able to notify the client say if it was unable to persist the message(s) to the message store?
>
> Thanks,
> Anirudha
>