6 Replies Latest reply on Jan 25, 2013 3:55 PM by jbertram

    HornetQ standalone - JMS Bridge?




      I'd like to use HornetQ standalone as a JMS Bridge (2.3 alpha 3) without transactions, however I'm getting issues with JBoss transaction related items not being found.


      Same exceptions as this person:



      Is it possible to use HornetQ standalone with JMS?




        • 1. Re: HornetQ standalone - JMS Bridge?

          Quick guess...Did you try removing the dependency of the bridge on the transaction manager?

          • 2. Re: HornetQ standalone - JMS Bridge?

            I removed the transaction references from the hornetq-beans.xml, didn't see other transaction references in the other config files in the config/standalone/non-clustered folder.


            <!-- The JMS Bridge -->

               <bean name="JMSBridge" class="org.hornetq.jms.bridge.impl.JMSBridgeImpl">


                           <!-- Source ConnectionFactory Factory -->


                               <inject bean="SourceCFF"/>


                           <!-- Target ConnectionFactory Factory -->


                               <inject bean="TargetCFF"/>


                           <!-- Source DestinationFactory -->


                               <inject bean="SourceDestinationFactory"/>


                           <!-- Target DestinationFactory -->


                               <inject bean="TargetDestinationFactory"/>


                           <!-- Source username (no username here) -->

                           <parameter><null /></parameter>

                           <!-- Source password (no password here)-->

                           <parameter><null /></parameter>

                           <!-- Target username (no username here)-->

                           <parameter><null /></parameter>

                           <!-- Target password (no password here)-->

                           <parameter><null /></parameter>

                           <!-- Selector -->

                           <parameter><null /></parameter>

                           <!-- Interval to retry in case of failure (in ms) -->


                           <!-- Maximum number of retries to connect to the source and target -->


                           <!-- Quality of service -->


                           <!-- Maximum batch size -->


                           <!-- Maximum batch time (-1 means infinite) -->


                           <!-- Subscription name (no subscription name here)-->

                           <parameter><null /></parameter>

                           <!-- client ID  (no client ID here)-->

                           <parameter><null /></parameter>

                           <!-- concatenate JMS messageID to the target's message header -->


                           <!-- register the JMS Bridge in the JMX MBeanServer -->


                               <inject bean="MBeanServer"/>




                  <!--     <property name="transactionManager">

                           <inject bean="TransactionManager"/>



                       <!-- HornetQ JMS Server must be started before the bridge -->





                   <bean name="TransactionManager" class="com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionManagerImple">






            13:37:35,558 INFO  [org.hornetq.core.server] HQ221003: HornetQ Server version 2.3.0.BETA3 (HornetQ sting, 122) [aaea1a2c-671c-11e2-9772-196f933b31ea]

            13:37:35,642 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=JMSBridge state=Create: java.lang.IllegalStateException: unable to create TransactionManager from org.hornetq.integration.jboss.tm.JBoss5TransactionManagerLocator.getTm

                    at org.hornetq.jms.bridge.impl.JMSBridgeImpl.getTm(JMSBridgeImpl.java:1000) [hornetq-jms-server.jar:]

                at org.hornetq.jms.bridge.impl.JMSBridgeImpl.start(JMSBridgeImpl.java:342 [hornetq-jms-server.jar:]
            • 3. Re: HornetQ standalone - JMS Bridge?

              Looks like the JMSBridgeImpl expects a TransactionManager to be defined and loaded, the getTM() will throw an exception if it can't load a transaction manager.


              TransactionManager tm = getTm();


                    // There may already be a JTA transaction associated to the thread


                    boolean ok;


                    Transaction toResume = null;



                       toResume = tm.suspend();


                       ok = setupJMSObjects();




                       if (toResume != null)






              How can a default transactionmanager be packaged with HornetQ so it won't fail on startup when using the JMSBridge feature?


              Will JMSBridge work with  IBM MQSeries endpoints if the HornetQ included with the latest JBoss is used instead of standalone?

              • 4. Re: HornetQ standalone - JMS Bridge?

                Ok, so the bridge is hard-wired to look for the transaction manager.  Since that's the case you can either:

                1. Not use the JMS bridge.  Maybe the HornetQ bridge would work for your use-case?
                2. Change the JMS bridge to not require the transaction manager.  This seems reasonable given that the bridge can be run in HornetQ standalone which does not have a JTA transaction manager by default.
                3. Run HornetQ in an application server which does have a JTA transaction manager (e.g. JBoss AS7 - you would need a nightly build since the JMS bridge isn't configurable in earlier versions).
                4. Install a JTA transaction manager in the HornetQ standalone server. I'm not even sure that's possible, but it's worth trying Naranaya again since the logging frameworks used by both should match now (Narayana uses JBoss Logging 3 and we switched that in HornetQ 2.3).  That should avoid the problem noted on https://community.jboss.org/thread/215861.  If you do get this working please report back and we can add instructions to the documentation.
                • 5. Re: HornetQ standalone - JMS Bridge?

                  I tried #4, which worked for me. 


                  Downloaded narayana-full-4.17.3.Final,   copied the transaction related jars from the lib folder tree into the hornetq lib folder.     After restart the server was able to load the transaction manager without exceptions.

                  • 6. Re: HornetQ standalone - JMS Bridge?

                    Thanks for the update.  I'll find a place in the docs for this.