activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
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 <massive.boisson@gmail.com> 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 (http://activemq.org/site/async-sends.html):
> "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
commit/rollback.

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.

http://incubator.apache.org/activemq/should-i-use-transactions.html


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

Yes


> 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?

-- 

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message