users@glassfish.java.net

Re: JMS Queue Routing

From: Sivakumar Thyagarajan <Sivakumar.Thyagarajan_at_Sun.COM>
Date: Tue, 27 Feb 2007 11:57:53 +0530

Daniel Cavalcanti wrote:
> Hello,
> I'm implementing a system based on JMS and have a question.
> ..
> Now, here is my question.
> How can a send a message from the producer (it's a session bean) all the
> way to the destination queue within a transaction, the RoutingQueue must
> not persist messages, and I can't lose messages.

Are you trying to handle the production of the message from the session bean to
the destination queue [via an intermediate routing MDB] in _one_ transaction?
No, this cannot be achieved. Here is a relevant snippet from the "Transactions"
section of http://docs.sun.com/app/docs/doc/819-4470/6n6kc3tdb?a=view
"The scope of a transaction is always a single session. That is, one or more
producer or consumer operations performed in the context of a single session can
be grouped into a single transaction. Since transactions span only a single
session, you cannot have an end-to-end transaction encompassing both the
production and consumption of a message."

Thanks
--Siva.

>
> Any ideas are very welcome.
> thanks,
> Daniel.