1 Reply Latest reply on Apr 10, 2015 5:15 PM by Justin Bertram

    Migrating to Wildfly 8.2 - Setting up a JMS bridge

    Michael Hongslo Newbie

      I'm looking upgrade our JBoss servers to Wildfly 8.2.  We currently are using JBoss AS 5.1.0.GA  (not EAP).  In order to migrate, we have to do one server at a time.  So its necessary for Wildfly to be able to form a JMS bridge between a Wildfly server and a JBoss 5.1.0 server.  Are there any examples I can use to setup this JMS bridge.   The bridge will be established on Wildfly (source) and the remote server is JBoss 5 (destination).   The server that will be be replaced with Wildfly forms the bridge just fine and finds the destination queue on the remote server.

       

      I have not had any luck with the configuration on wildfly.

       

                 <jms-bridge name="request-bridge">

                      <source>

                          <connection-factory name="ConnectionFactory"/>

                          <destination name="queue/TestRequests"/>

                      </source>

                      <target>

                          <connection-factory name="/jms/RemoteConnectionFactory"/>

                          <destination name="queue/RemoteTestRequest"/>

                          <context>

                              <property key="java.naming.factory.initial" value="org.jboss.naming.remote.client.InitialContextFactory"/>

                              <property key="java.naming.provider.url" value="remote://10.153.24.244:4457"/>

                          </context>

                      </target>

                      <quality-of-service>AT_MOST_ONCE</quality-of-service>

                      <failure-retry-interval>10000</failure-retry-interval>

                      <max-retries>1</max-retries>

                      <max-batch-size>10</max-batch-size>

                      <max-batch-time>100</max-batch-time>

                      <add-messageID-in-header>true</add-messageID-in-header>

                  </jms-bridge>

       

      On startup, Wildfly log files contain the following exception

       

      17:55:20,082 WARN  [org.hornetq.jms.server] (pool-1-thread-1) HQ122010: Failed to connect JMS Bridge: javax.naming.Commu

      nicationException: Failed to connect to any server. Servers tried: [remote://10.153.24.244:4457 (Operation failed with s

      tatus WAITING after 5000 MILLISECONDS)] [Root exception is java.net.ConnectException: Operation failed with status WAITI

      NG after 5000 MILLISECONDS]

              at org.jboss.naming.remote.client.HaRemoteNamingStore.failOverSequence(HaRemoteNamingStore.java:240) [jboss-remo

      te-naming-2.0.1.Final.jar:2.0.1.Final]

              at org.jboss.naming.remote.client.HaRemoteNamingStore.namingStore(HaRemoteNamingStore.java:149) [jboss-remote-na

      ming-2.0.1.Final.jar:2.0.1.Final]

              at org.jboss.naming.remote.client.HaRemoteNamingStore.namingOperation(HaRemoteNamingStore.java:130) [jboss-remot

      e-naming-2.0.1.Final.jar:2.0.1.Final]

              at org.jboss.naming.remote.client.HaRemoteNamingStore.lookup(HaRemoteNamingStore.java:272) [jboss-remote-naming-

      2.0.1.Final.jar:2.0.1.Final]

              at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:87) [jboss-remote-naming-2.0.1.Final.j

      ar:2.0.1.Final]

              at org.jboss.naming.remote.client.RemoteContext.lookup(RemoteContext.java:129) [jboss-remote-naming-2.0.1.Final.

      jar:2.0.1.Final]

              at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_71]

              at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_71]

              at org.hornetq.jms.bridge.impl.JNDIFactorySupport.createObject(JNDIFactorySupport.java:56) [hornetq-jms-server-2

      .4.5.Final.jar:]

              at org.hornetq.jms.bridge.impl.JNDIDestinationFactory.createDestination(JNDIDestinationFactory.java:38) [hornetq

      -jms-server-2.4.5.Final.jar:]

              at org.hornetq.jms.bridge.impl.JMSBridgeImpl.setupJMSObjects(JMSBridgeImpl.java:1233) [hornetq-jms-server-2.4.5.

      Final.jar:]

              at org.hornetq.jms.bridge.impl.JMSBridgeImpl.setupJMSObjectsWithRetry(JMSBridgeImpl.java:1471) [hornetq-jms-serv

      er-2.4.5.Final.jar:]

              at org.hornetq.jms.bridge.impl.JMSBridgeImpl.access$2200(JMSBridgeImpl.java:76) [hornetq-jms-server-2.4.5.Final.

      jar:]

              at org.hornetq.jms.bridge.impl.JMSBridgeImpl$FailureHandler.run(JMSBridgeImpl.java:2079) [hornetq-jms-server-2.4

      .5.Final.jar:]

              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_71]

              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_71]

              at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_71]

      Caused by: java.net.ConnectException: Operation failed with status WAITING after 5000 MILLISECONDS

              at org.jboss.naming.remote.protocol.IoFutureHelper.get(IoFutureHelper.java:97) [jboss-remote-naming-2.0.1.Final.

      jar:2.0.1.Final]

              at org.jboss.naming.remote.client.HaRemoteNamingStore.failOverSequence(HaRemoteNamingStore.java:198) [jboss-remo

      te-naming-2.0.1.Final.jar:2.0.1.Final]

              ... 16 more

       

       

      On my JBoss 5.1.0.GA server (the destination), the following is output in the log when Wildfly attempts to connect

       

      2015-04-10 17:55:21,432 ERROR [org.jboss.remoting.transport.socket.ServerThread]

      (WorkerThread#10[10.153.24.251:64505]) WorkerThread#10[10.153.24.251:64505] exc

      eption occurred during first invocation

      java.io.IOException: Can not read data for version 0.  Supported versions: 1,2,2

      2

              at org.jboss.remoting.transport.socket.ServerThread.versionedRead(Server

      Thread.java:910)

              at org.jboss.remoting.transport.socket.ServerThread.completeInvocation(S

      erverThread.java:754)

              at org.jboss.remoting.transport.socket.ServerThread.processInvocation(Se

      rverThread.java:744)

              at org.jboss.remoting.transport.socket.ServerThread.dorun(ServerThread.j

      ava:548)

              at org.jboss.remoting.transport.socket.ServerThread.run(ServerThread.jav

      a:234)

       

      What am I doing wrong?!

       

      Message was edited by: jaikiran pai - Edited the subject line to include "Setting up a JMS bridge" to get the attention of the right people.

        • 1. Re: Migrating to Wildfly 8.2
          Justin Bertram Master

          At the very least I believe you are using improper JNDI properties for the bridge's connection to JBoss AS 5.1.  Here's what your using currently:

           

          <context>
              <property key="java.naming.factory.initial" value="org.jboss.naming.remote.client.InitialContextFactory"/>
              <property key="java.naming.provider.url" value="remote://10.153.24.244:4457"/>
          </context>
          

           

          These are the kinds of JNDI properties you'd use to connect to a remote Wildfly instance.

           

          Instead, I think you should use something like this:

           

          <context>
              <property key="java.naming.factory.initial" value="org.jnp.interfaces.NamingContextFactory"/>
              <property key="java.naming.provider.url" value="jnp://10.153.24.244:1099"/>
              <property key="java.naming.factory.url.pkgs" value="org.jboss.naming:org.jnp.interfaces"/>
          </context>
          

           

          Aside from that I'm not clear on why your source would be the Wildfly server and the target would be the JBoss AS 5.1 server.  If you want to move messages from JBoss AS 5.1 then it should be the source.