5 Replies Latest reply on Apr 24, 2012 12:10 PM by Rüdiger zu Dohna

    Tips for implementing HornetQ JMS Bridge for JBoss7

    qtm Newbie

      Hi,

       

      Since I don't know when https://issues.jboss.org/browse/AS7-4268 will be done, I might implement a custom HornetQ JMS Bridge. My aim is to connect JBM and HornetQ, JBossMQ would be nice to have. Also, I'm working in a clustered environment so avoiding JNDI for the HornetQ part because of the limitation of "remote://host:port" would be a big plus.

      Could you give me some tips on how to implement the bridge?

       

      Thanks

        • 1. Re: Tips for implementing HornetQ JMS Bridge for JBoss7
          Justin Bertram Master

          You don't need to write any bridge code as it is already shipped as part of HornetQ.  There's just no "managed" way to create the bridge yet.  However, it should be possible to create a bridge via your own code that instantiates a org.hornetq.jms.bridge.impl.JMSBridgeImpl.  You'll need to create a few other classes to feed into the constructor (e.g. org.hornetq.jms.bridge.impl.JNDIDestinationFactory and org.hornetq.jms.bridge.impl.JNDIConnectionFactoryFactory), but it should all be pretty straight forward.  My recommendation at this point would be to create an MBean wrapper around this.  See this article for more details on that part.

          2 of 2 people found this helpful
          • 2. Re: Tips for implementing HornetQ JMS Bridge for JBoss7
            qtm Newbie

            Hi,

             

            That example worked, but this one http://middlewaremagic.com/jboss/?p=1081 didn't. And I need to add jars to my sar archive.

            the error is :

             

            New missing/unsatisfied dependencies:

                  service jboss.module.spec.service."deployment.CustomJMSBridgeWorking.sar.Test.jar".main (missing) dependents: [service jboss.module.service."deployment.CustomJMSBridge.sar".main]

             

            16:09:25,648 ERROR [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) {"JBAS014653: Composite operation failed and was rolled back. Steps that failed:" => {"Operation step-2" => {"JBAS014771: Services with missing/unavailable dependencies" => ["jboss.module.service.\"deployment.CustomJMSBridge.sar\".mainjboss.module.spec.service.\"deployment.CustomJMSBridgeWorking.sar.Test.jar\".mainMissing[jboss.module.service.\"deployment.CustomJMSBridge.sar\".mainjboss.module.spec.service.\"deployment.CustomJMSBridgeWorking.sar.Test.jar\".main]"]}}}

             

            Any idea? I'm using Brontes - 7.1.1

             

            thanks

            • 3. Re: Tips for implementing HornetQ JMS Bridge for JBoss7
              qtm Newbie

              Nevermind the above error, it was caused because I didn't copy my files to the modules folder. As an alternative, you could simply delete the      <module name="deployment.ServerMonitorServiceWorking.sar.Test.jar" />  line.

               

              Are there are any restrictions(in performance/ specification) on the Bridge - like using a MDB for bridging from HQ(located on the same JBoss as the bridge SAR) to JBM? Is it safe to locate the bridge on one JBoss and do the bridging between other 2 servers?

              • 4. Re: Tips for implementing HornetQ JMS Bridge for JBoss7
                Justin Bertram Master

                I'm not sure what you mean by "...using a MDB for bridging..."  If you have a bridge configured then the bridge will do the bridging between the two servers.  What you do with the messages when they arrive as the target server is completely up to you.  You can consume them with an MDB, a remote client, etc.

                 

                The bridge can be located on a 3rd server which isn't either the "source" or the "target," but performance will be quite a bit worse.