3 Replies Latest reply: Mar 12, 2010 8:13 AM by Vicky Kak RSS

JMS Bridge and JMS Provider Resource Adapter (JCA)

Bertrand GILLIS Newbie

Hi folks !

 

This question was also posted on JBoss Messaging Discussions (http://community.jboss.org/thread/149178).

 

I'm trying to setup a JMS bridge beween  JBoss Messaging running inside JBoss 5.1.0 and WebSphere MQ 6.0.2 (WMQ)  running as a standalone application.

 

Our major  requirement is to have a Quality of Service (QoS) QOS_ONCE_AND_ONLY_ONCE  between both JMS Providers.

This QoS requires that both  connection factories must be XAConnectionFactory implementations.

 

The  recommended way to integrate a JMS Provider inside a J2EE server is  always to use the available JMS Resource Adapter.

So for WMQ, we  must deploy wmq.jmsra.rar in JBoss AS as explained on this wiki page: http://community.jboss.org/wiki/UsingWebSphereMQSeriesWithJBossASPart4.  And the JMS Bridge is working flawlessly when using QoS  QOS_AT_MOST_ONCE and QOS_DUPLICATES_OK. But as soon as we use QoS  QOS_ONCE_AND_ONLY_ONCE, the JMS Bridge doesn't start anymore and the  following Exception is thrown.

 

17:15:38,302 WARN   [Bridge] jboss.messaging:name=JMSBridge,service=Bridge Failed to set up  connections
java.lang.IllegalArgumentException: Connection factory must be  XAConnectionFactory
         at  org.jboss.jms.server.bridge.Bridge.createConnection(Bridge.java:880)
         at  org.jboss.jms.server.bridge.Bridge.setupJMSObjects(Bridge.java:1015)
         at  org.jboss.jms.server.bridge.Bridge.setupJMSObjectsWithRetry(Bridge.java:1223)
         at  org.jboss.jms.server.bridge.Bridge.access$1600(Bridge.java:68)
         at  org.jboss.jms.server.bridge.Bridge$FailureHandler.run(Bridge.java:1569)
         at java.lang.Thread.run(Thread.java:619)

 

As a  matter of fact, all JMS Resource Adaptors implement the  ConnectionFactory interface only as described in the J2EE Connector  Architecture
Specification (JSR112). That's the case for IBM WMQ Resource Adaptor,  Apache Active MQ Resource Adaptor and JBoss Messaging Resource Adaptor  as well. 

 

So how is it possible to use the QoS  QOS_ONCE_AND_ONLY_ONCE in a JMS Bridge if it is not possible to obtain a  XAConnectionFactory from a JMS Resource Adaptor ?

 

Do  we have to connect directly to the JMS Provider to obtain a  XAConnectionFactory instead of using the JMS Provider resource Adaptor  available ? If so, could you describe the procedure to follow ?

 

Thank  you very much for your assistance.

 

Bertrand