activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: sync vs async sends (was Re: AMQ4.0-M2: Explanation for observed low t)
Date Mon, 12 Jun 2006 16:02:27 GMT
On 6/12/06, massive.boisson <> wrote:
> Hi all;
> In one topic I saw this:
> Hiram Chirino wrote:
> >
> > sync send means that the send method blocks until the broker confirms
> > that the message has been persisted on disk.
> > Regards,
> > Hiram
> >
> In docs it says (
> "The cases that we are forced to send in sync mode are when persistent
> messages are being sent outside of a transaction."
> To confirm, if I am sending a persistent transacted message, the default
> setting is async?

Yes. In a transaction all operations are async - apart from the final

This is why for multiple-operations (like consuming a message and
sending multiple messages on) you should always use a JMS transaction
as its faster.

> Can I make it sync by doing jms.useAsyncSend=false?


> Semi related question: when async send is used, is there a way to find out
> if the send was successful or not with some kind of ExceptionListener or
> something?

Yes - the ExceptionListener should hear any exceptions.

I wonder if we could add a neater non-JMS extension to ActiveMQ to
make it easier to be notified asynchonously of which Message objects
could not be sent? I guess we could just use the ExceptionListener and
use a custom type of Exception which contained the Message object?



View raw message