3 Replies Latest reply on Mar 12, 2010 8:13 AM by vickyk

    JMS Bridge and JMS Provider Resource Adapter (JCA)

    bgillis

      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


        • 1. Re: JMS Bridge and JMS Provider Resource Adapter (JCA)
          vickyk

          It looks more as an JMS related query,  just wait for the response of the messaging team on the other cross post.

          • 2. Re: JMS Bridge and JMS Provider Resource Adapter (JCA)
            bgillis

            Thanks Vicky... So I will wait a response from JBoss Messaging Team.

             

            But could you explain why Resource Adaptors only expose connection factory as ConnectionFactory and never as XAConnectionFactory ? I've just discovered that HornetQ is currently the only JMS Provider available that exposes connection factory as both ConnectionFactory and XAConnectionFactory (see class org.hornetq.ra.HornetQRAConnectionFactoryImpl).

            • 3. Re: JMS Bridge and JMS Provider Resource Adapter (JCA)
              vickyk

              bgillis wrote :

              But could you explain why Resource Adaptors only expose connection factory as ConnectionFactory and never as XAConnectionFactory ?

              The JCA specs points to expose the CF via JNDI to the component, the CF could be based on CCI interface or non-cci based.

              1 of 1 people found this helpful