1 2 Previous Next 24 Replies Latest reply on Sep 8, 2011 10:51 AM by Martin Meyka

    Transfer messages from stand alone hornetq to jbossmq

    Puneet Bansal Newbie

      We have a situation where we are upgrading our JMS from jbossmq on Jboss 4.0.5 GA to a new stand alone HornetQ. We can modify all publishers to publish messages to HornetQ servers but can not modify all Subscribers to connect to HornetQ. So we need HornetQ to send messages to old Jboss 4.0.5 servers. I believe this is achievable using JMS Bridge on Jboss 4.0.5 servers but not sure how to setup bridge on Jboss 4.0.5 servers. Can some body point to the configurations?

        • 1. Re: Transfer messages from stand alone hornetq to jbossmq
          Andy Taylor Master

          you can either deploy it on the hornetq side by adding it to the beans file or wrap it in your own mbean and deploy it on the jboss side. Also i guess you could have it sit in your own app separately and start it programmatically.

          • 2. Re: Transfer messages from stand alone hornetq to jbossmq
            Puneet Bansal Newbie

            "deploy it on hornetq side .." does it mean something like this: http://hornetq.sourceforge.net/docs/hornetq-2.0.0.GA/user-manual/en/html/jms-bridge.html ?

            So here source  will be the localhost (hornetQ stand alone server) and target will be my remote Jboss 4.0.5 server ?
            Please correct me if I am going wrong some where.

            • 4. Re: Transfer messages from stand alone hornetq to jbossmq
              Puneet Bansal Newbie

              Tried setting up bridge on hornetQ server. Copied jars from Jboss 4.0.5 to hornetQ lib, but server is not coming up. Exception logs:

               

              [main] 06:45:08,374 SEVERE [org.hornetq.integration.bootstrap.HornetQBootstrapServer]  Failed to start server

              java.lang.IllegalStateException: Incompletely deployed:

               

              DEPLOYMENTS MISSING DEPENDENCIES:

                Deployment "JMSBridge" is missing the following dependencies:

                  Dependency "RealTransactionManager" (should be in state "Installed", but is actually not found)

               

                      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:278)

                      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174)

                      at org.hornetq.integration.bootstrap.HornetQBootstrapServer.bootstrap(HornetQBootstrapServer.java:158)

                      at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:83)

                      at org.hornetq.integration.bootstrap.HornetQBootstrapServer.run(HornetQBootstrapServer.java:116)

                      at org.hornetq.integration.bootstrap.HornetQBootstrapServer.main(HornetQBootstrapServer.java:73)

              Exception in thread "main" java.lang.IllegalStateException: Incompletely deployed:

               

              DEPLOYMENTS MISSING DEPENDENCIES:

                Deployment "JMSBridge" is missing the following dependencies:

                  Dependency "RealTransactionManager" (should be in state "Installed", but is actually not found)

               

                      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.internalValidate(AbstractKernelDeployer.java:278)

                      at org.jboss.kernel.plugins.deployment.AbstractKernelDeployer.validate(AbstractKernelDeployer.java:174)

                      at org.hornetq.integration.bootstrap.HornetQBootstrapServer.bootstrap(HornetQBootstrapServer.java:158)

                      at org.jboss.kernel.plugins.bootstrap.AbstractBootstrap.run(AbstractBootstrap.java:83)

                      at org.hornetq.integration.bootstrap.HornetQBootstrapServer.run(HornetQBootstrapServer.java:116)

                      at org.hornetq.integration.bootstrap.HornetQBootstrapServer.main(HornetQBootstrapServer.java:73)

               

               

              Not sure if there is any specific jar missing.

              • 5. Re: Transfer messages from stand alone hornetq to jbossmq
                Andy Taylor Master

                the conf is just an example, you will have to change it to suite the env, i'm guessing the tm isnt deployed

                • 6. Re: Transfer messages from stand alone hornetq to jbossmq
                  Andy Taylor Master

                  take a look at the jms-brigge example, i think this creates a transaction manager

                  • 7. Re: Transfer messages from stand alone hornetq to jbossmq
                    Puneet Bansal Newbie

                    Could not find transactionmanager impl class in jms-bridge example. Do we need to define one and if yes how?

                    • 8. Re: Transfer messages from stand alone hornetq to jbossmq
                      Andy Taylor Master

                      yes the JMS Bridge needs a transaction manager, it uses it to gaurantee delivery. in the jms bridge example we just use the jboss TM like this

                       

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

                             </bean>

                       

                      and inject it into the bridge, just do something similar.

                      • 9. Re: Transfer messages from stand alone hornetq to jbossmq
                        Puneet Bansal Newbie

                        Thanks Andy, was able to bring up the server using transaction manager. But still Bridge refuses to work
                        Getting the below exception after server starts:

                        javax.jms.JMSException: mypackage.db.Bus$Sendable

                                at java.net.URLClassLoader$1.run(URLClassLoader.java:202)

                                at java.security.AccessController.doPrivileged(Native Method)

                                at java.net.URLClassLoader.findClass(URLClassLoader.java:190)

                                at java.lang.ClassLoader.loadClass(ClassLoader.java:307)

                                at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)

                                at java.lang.ClassLoader.loadClass(ClassLoader.java:248)

                                at java.lang.Class.forName0(Native Method)

                                at java.lang.Class.forName(Class.java:247)

                                at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604)

                                at org.hornetq.utils.ObjectInputStreamWithClassLoader.resolveClass(ObjectInputStreamWithClassLoader.java:69)

                                at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)

                                at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)

                                at java.io.ObjectInputStream.readArray(ObjectInputStream.java:1624)

                                at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1323)

                                at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)

                                at org.hornetq.jms.client.HornetQObjectMessage.getObject(HornetQObjectMessage.java:158)

                                at org.jboss.mq.SpyMessageProducer.encapsulateMessage(SpyMessageProducer.java:346)

                                at org.jboss.mq.SpyMessageProducer.send(SpyMessageProducer.java:237)

                                at org.hornetq.jms.bridge.impl.JMSBridgeImpl.sendMessages(JMSBridgeImpl.java:1567)

                                at org.hornetq.jms.bridge.impl.JMSBridgeImpl.sendBatchNonTransacted(JMSBridgeImpl.java:1417)

                                at org.hornetq.jms.bridge.impl.JMSBridgeImpl.sendBatch(JMSBridgeImpl.java:1392)

                                at org.hornetq.jms.bridge.impl.JMSBridgeImpl.access$1500(JMSBridgeImpl.java:68)

                                at org.hornetq.jms.bridge.impl.JMSBridgeImpl$SourceReceiver.run(JMSBridgeImpl.java:1786)

                                at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

                                at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

                                at java.lang.Thread.run(Thread.java:619)

                         

                        Looks like hornetQ is trying to load the wrapper class of my message (Sendable). Do we need to have it on my hornetQ server fot it to successfully push messages to another JMS?
                        Everthing works fime when I dont use bridging and my subscriber just gets the message from hornetQ so why is it looking for my class in case of a bridge?

                        • 10. Re: Transfer messages from stand alone hornetq to jbossmq
                          Andy Taylor Master

                          Im guessing you have to make your classes available on the classloader, try adding them to the lib

                          • 11. Re: Transfer messages from stand alone hornetq to jbossmq
                            Martin Meyka Newbie

                            So, do I understand it right that if I want to connect from a standalone hornetQ to a 2-node cluster (master, backup) I have to use JMS Bridges (all running 2.2.2) because a core bridge can only connect to single dedicated node and not to a cluster. In 2.1.2 it seemed to be possible (as far as I see from Documention) because there was connector-ref for master and backup but in 2.2.2 there are static-connectors for a core bridge. Sorrowly the documentation has still the connector-ref in it, so I don't know whether I use it right or not. 

                            • 12. Re: Transfer messages from stand alone hornetq to jbossmq
                              Andy Taylor Master

                              So, do I understand it right that if I want to connect from a standalone hornetQ to a 2-node cluster (master, backup) I have to use JMS Bridges (all running 2.2.2) because a core bridge can only connect to single dedicated node and not to a cluster.

                              Both JMS bridges and core bridges connect to a single node, im not really sure what you mean here.

                               

                              it seemed to be possible (as far as I see from Documention) because there was connector-ref for master and backup but in 2.2.2 there are static-connectors for a core bridge. Sorrowly the documentation has still the connector-ref in it, so I don't know whether I use it right or not.

                              Im not sure what you mean but you can use static connectors or discovery if need be

                              • 13. Re: Transfer messages from stand alone hornetq to jbossmq
                                Martin Meyka Newbie

                                I have a standalone hornetQ that sends messages via a bridge to hornetQ broker that is the master of a 2 node cluster (standalone, no JBoss at all). I would like to have failover so that the bridge connects to the backup if the master is not available and connects back to the master after recovery. First I used a core bridge with one static connector to the master. Then I added a connector to the backup as well to the static-connectors of the core bridge but then the bridge does not work at all. As far as I experienced any client of the master/backup cluster will proper failover if the connectors are looked up by JNDI. So I thought I must use a JMS bridge instead of the core bridge because the JMS bridge can be configured to retrieve the connectors by JNDI.

                                So my cluster is doing the failover very, very well and I want the bridge to do so as well.

                                • 14. Re: Transfer messages from stand alone hornetq to jbossmq
                                  Andy Taylor Master

                                  make sure the brisge is configured correctly, reconnectAttempts etc

                                  1 2 Previous Next