You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by cjruffy <cj...@gmail.com> on 2011/07/06 17:51:29 UTC

XA transactions with JNDI defined JMS connection factories

Hello,

Using Websphere MQ 7 and Websphere 7, Camel 2.6, Spring 2.5.6.

Scenario 1 
I have a JMS consumer on one queue manager and a JMS producer on another
queue manager a route is enlisted in an XA transaction and the source
message is successfully rolled back to the source queue as expected. This is
when the connection factory is defined in the spring.xml file.

Scenario 2
Looking up the connection factory defined in Websphere App server via JNDI
does not show the same behavior. The transaction is rolled back but the
message is not rolled back to the source queue. If we use the same queue
manager for source and destination it will rollback. It appears to be using
local transactions for this type of configuration.

Unfortunately our clients will require JNDI for security reasons so we need
to get this working.

I have looked throughout this forum I noticed someone has got it working
with jboss by deploying separate resource adapters for each queue manager:

http://camel.465427.n5.nabble.com/Camel-Spring-and-XA-td466686.html#a466687

Many Thanks

Chris


--
View this message in context: http://camel.465427.n5.nabble.com/XA-transactions-with-JNDI-defined-JMS-connection-factories-tp4557202p4557202.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: XA transactions with JNDI defined JMS connection factories

Posted by cjruffy <cj...@gmail.com>.
Thanks for the reply Ashwin,

I've read the Websphere docs and its pretty much a simple case of checking
the checkbox 'Support distributed two-phase commit protocol' to enable
XA-transactions. This is what we have. Our existing software which doesnt
use camel or spring and uses EJB's works fine with JNDI. Ill try some other
scenarios.



On 6 July 2011 18:30, Ashwin Karpe [via Camel] <
ml-node+4557477-2112266617-227500@n5.nabble.com> wrote:

> Hi,
>
> While I am no expert on Websphere, I believe, based n the behavior you have
> noted, that transactional behavior is incorrectly set on the connection
> factory in Websphere.
>
> Transacation rollback or NACK needs to be propagated by the connection back
> to the broker which either restores the message back on the queue after
> updating the retry count. Looks like the connection is not doing so or is
> not configured to do so.
>
> Hence the broker gets rid of its copy and the message is lost.
>
> Cheers,
>
> Ashwin...
> ---------------------------------------------------------
> Ashwin Karpe
> Apache Camel Committer & Sr Principal Consultant
> FUSESource (a Progress Software Corporation subsidiary)
> http://fusesource.com
>
> Blog:http://opensourceknowledge.blogspot.com
> ---------------------------------------------------------
>
>
> ------------------------------
>  If you reply to this email, your message will be added to the discussion
> below:
>
> http://camel.465427.n5.nabble.com/XA-transactions-with-JNDI-defined-JMS-connection-factories-tp4557202p4557477.html
>  To unsubscribe from XA transactions with JNDI defined JMS connection
> factories, click here<http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4557202&code=Y2pydWZmeUBnbWFpbC5jb218NDU1NzIwMnwtNDIzNDY3OTA4>.
>
>


--
View this message in context: http://camel.465427.n5.nabble.com/XA-transactions-with-JNDI-defined-JMS-connection-factories-tp4557202p4560388.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: XA transactions with JNDI defined JMS connection factories

Posted by Ashwin Karpe <ak...@fusesource.com>.
Hi,

While I am no expert on Websphere, I believe, based n the behavior you have
noted, that transactional behavior is incorrectly set on the connection
factory in Websphere. 

Transacation rollback or NACK needs to be propagated by the connection back
to the broker which either restores the message back on the queue after
updating the retry count. Looks like the connection is not doing so or is
not configured to do so.

Hence the broker gets rid of its copy and the message is lost.

Cheers,

Ashwin... 

-----
---------------------------------------------------------
Ashwin Karpe
Apache Camel Committer & Sr Principal Consultant
FUSESource (a Progress Software Corporation subsidiary)
http://fusesource.com 

Blog: http://opensourceknowledge.blogspot.com 
---------------------------------------------------------
--
View this message in context: http://camel.465427.n5.nabble.com/XA-transactions-with-JNDI-defined-JMS-connection-factories-tp4557202p4557477.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: XA transactions with JNDI defined JMS connection factories

Posted by cjruffy <cj...@gmail.com>.
Oh yes, the question is... has anyone got any working examples? Or had a
similar problem? Cheers

--
View this message in context: http://camel.465427.n5.nabble.com/XA-transactions-with-JNDI-defined-JMS-connection-factories-tp4557202p4557206.html
Sent from the Camel - Users mailing list archive at Nabble.com.