5 Replies Latest reply on Aug 2, 2016 9:53 PM by daled

    Connect to wildfly 8.2 hornetq from wildfly 10

    akki192

      I am migrating an old application which is currently running on jboss 5.1.2 to wildfly 10. The application is remotely consuming messages from a remote topic hosted on "wildfly 8.2 hornetq".

       

      I have done following changes to my standalone.xml:

      a. Added socket binding

      <outbound-socket-binding name="messaging-remote">

          <remote-destination host="wildfly-8.2-host" port="18080"/>

      </outbound-socket-binding>

       

      b. Created http-connector with socket binding:

      <http-connector name="http-remote" endpoint="http-acceptor" socket-binding="messaging-remote"/>

       

      c. created pooled-connection-factory.

      <pooled-connection-factory name="activemq-ra-remote" transaction="xa" entries="java:/RemoteTestJMSProvider" connectors="http-remote" user="guest" password="guest"/>

       

      My MDB is configured as:

      @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),

         @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/topic/Link"),

         @ActivationConfigProperty(propertyName = "providerAdapterJNDI", propertyValue = "java:/RemoteTestJMSProvider"),

         @ActivationConfigProperty(propertyName = "useDLQ", propertyValue = "false"),

         @ActivationConfigProperty(propertyName = "clientID", propertyValue = "Library"),

         @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),

         @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "Library.LinkingBean.wf"),

         @ActivationConfigProperty(propertyName = "user", propertyValue = "guest"),

         @ActivationConfigProperty(propertyName = "password", propertyValue = "guest"),

         @ActivationConfigProperty(propertyName = "reconnectAttempts", propertyValue = "32"),

         @ActivationConfigProperty(propertyName = "reconnectInterval", propertyValue = "900") //in seconds

           })

      @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)

      @ResourceAdapter("activemq-ra-remote")

      public class LinkMDB implements MessageListener {

       

      I see a warning message displayed in logs and I am not able to receive any messages.

       

      2016-06-03 17:55:31,875 WARN  [org.jboss.activemq.artemis.wildfly.integration.recovery] (MSC service thread 1-1) AMQ122018: Could not start recovery discovery on XARecoveryConfig [transportConfiguration=[TransportConfiguration(name=, factory=org-apache-activemq-artemis-core-remoting-impl-netty-NettyConnectorFactory) ?httpUpgradeEnabled=true&httpPpgradeEndpoint=http-acceptor&port=18080&localAddress=::&host=wildfly-8.2-host], discoveryConfiguration=null, username=guest, password=****, JNDI_NAME=java:/RemoteTestJMSProvider], we will retry every recovery scan until the server is available

       

      I am able to listen messages on the same server using a standalone client. Any idea what I am doing wrong?

        • 1. Re: Connect to wildfly 8.2 hornetq from wildfly 10
          jbertram

          Couple of things:

          • The ActiveMQ Artemis JCA RA in Wildfly 10 doesn't support the "providerAdapterJNDI" or "useDLQ" activation configuration properties so you can get rid of those.
          • You don't need the @ResourceAdapter annotation on the MDB or the outbound-socket-binding, http-connector, and pooled-connection-factory.
          • Use the "connectorClassName" and "connectionParameters" activation configuration properties, e.g.:

           

          @ActivationConfigProperty(propertyName = "connectorClassName", propertyValue = "org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory"),
          @ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=wildfly-8.2-host;port=18080")
          
          • 2. Re: Connect to wildfly 8.2 hornetq from wildfly 10
            akki192

            Justin, Thanks for quick response.

             

            As suggested, I modified my MDB configuration as below and also removed outbound-socket-binding, http-connector, and pooled-connection-factory from standalone.xml.

             

            Now, I get a warning message displayed below and the MDB is still not consuming any message.

             

            @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),

               @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/topic/Master"),

               @ActivationConfigProperty(propertyName = "connectorClassName", propertyValue = "org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory"),

               @ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=wildfly-8.2-host;port=18080")

               @ActivationConfigProperty(propertyName = "clientID", propertyValue = "Library"),

               @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),

               @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "Library.LinkingBean.wf"),

               @ActivationConfigProperty(propertyName = "user", propertyValue = "guest"),

               @ActivationConfigProperty(propertyName = "password", propertyValue = "guest"),

               @ActivationConfigProperty(propertyName = "reconnectAttempts", propertyValue = "32"),

               @ActivationConfigProperty(propertyName = "reconnectInterval", propertyValue = "900") //in seconds

               })

            @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)

            public class LinkMDB implements MessageListener {

             

            2016-06-06 16:06:22,002 WARN  [org.apache.activemq.artemis.core.client] (Thread-107 (ActiveMQ-client-global-threads-606908500)) AMQ212037: Connection failure has been detected: AMQ119011: Did not receive data from server for org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnection@23993f40[local= 0.0.0.0/0.0.0.0:40629, remote=null] [code=CONNECTION_TIMEDOUT]

             

            After 7-8 minutes, I see the below warning in the application logs:

             

            2016-06-06 16:28:00,645 WARN  [org.apache.activemq.artemis.ra] (default-threads - 4) AMQ152005: Failure in broker activation org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec(ra=org.apache.activemq.artemis.ra.ActiveMQResourceAdapter@78712571 destination=jms/topic/Master destinationType=javax.jms.Topic ack=Auto-acknowledge durable=true clientID=Library subscription=Library.LinkingBean.wf user=guest password=**** maxSession=15): ActiveMQConnectionTimedOutException[errorType=CONNECTION_TIMEDOUT message=AMQ119013: Timed out waiting to receive cluster topology. Group:null]

                    at org.apache.activemq.artemis.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:813)

                    at org.apache.activemq.artemis.ra.inflow.ActiveMQActivation.setup(ActiveMQActivation.java:315)

                    at org.apache.activemq.artemis.ra.inflow.ActiveMQActivation$SetupActivation.run(ActiveMQActivation.java:719)

                    at org.jboss.jca.core.workmanager.WorkWrapper.run(WorkWrapper.java:223)

                    at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33)

                    at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:808)

                    at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45)

                    at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:828)

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

                    at org.jboss.threads.JBossThread.run(JBossThread.java:320)

             

            As I was running out of options, I tried downgrading the server version to Wildfly 9.2 and I was able to successfully receive message in my MDB with below configuration.

             

            @MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),

               @ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/topic/Master"),

               @ActivationConfigProperty(propertyName="connectorClassName", propertyValue = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"),

               @ActivationConfigProperty(propertyName="connectionParameters", propertyValue = "host=wildfly-8.2-host;port=18080;http-upgrade-enabled=true"),

               @ActivationConfigProperty(propertyName = "clientID", propertyValue = "Library"),

               @ActivationConfigProperty(propertyName = "subscriptionDurability", propertyValue = "Durable"),

               @ActivationConfigProperty(propertyName = "subscriptionName", propertyValue = "Library.LinkingBean.wf"),

               @ActivationConfigProperty(propertyName = "user", propertyValue = "guest"),

               @ActivationConfigProperty(propertyName = "password", propertyValue = "guest"),

               @ActivationConfigProperty(propertyName = "reconnectAttempts", propertyValue = "32"),

               @ActivationConfigProperty(propertyName = "reconnectInterval", propertyValue = "60")

               })

            @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)

            public class LinkMDB implements MessageListener {

             

            Tried using "httpUpgradeEnabled" instead of "http-upgrade-enabled" in the "connectionParameters" activation configuration propertyValue as you had mentioned in one of the threads but, this did not help in wildfly 10. I see below message in the logs and not receiving any messages but, no more see the error mentioned above:

             

            20:15:38,874 INFO  [org.apache.activemq.artemis.ra] (default-threads - 5) AMQ151001: Attempting to reconnect org.apache.activemq.artemis.ra.inflow.ActiveMQActivationSpec(ra=org.apache.activemq.artemis.ra.ActiveMQResourceAdapter@78712571 destination=jms/topic/Master destinationType=javax.jms.Topic ack=Auto-acknowledge durable=true clientID=Library subscription=Library.LinkingBean.wf user=guest password=**** maxSession=15)

            • 3. Re: Connect to wildfly 8.2 hornetq from wildfly 10
              jbertram

              It's possible that the two HornetQ versions are not compatible.  If that's the case then I'd recommend either upgrading the old one or configuring a JMS bridge to move the messages across using the proper client jars.

              • 4. Re: Connect to wildfly 8.2 hornetq from wildfly 10
                akki192

                I think I'll migrate my application from jboss 5.2 to wildfly 9.2 for now and then migrate both of them to wildfly 10 at the same time to avoid this problem. Thanks for your help!

                • 5. Re: Connect to wildfly 8.2 hornetq from wildfly 10
                  daled

                  You need to specify the protocol-manager-factory in your pooled-connection-factory so that it looks something like this:

                   

                  <pooled-connection-factory

                  name="activemq-ra-remote"

                  transaction="xa"

                  connectors="hornetq-connector"

                  user="guest"

                  password="guest"

                  entries="java:/RemoteTestJMSProvider"

                  protocol-manager-factory="org.apache.activemq.artemis.core.protocol.hornetq.client.HornetQClientProtocolManagerFactory"/>

                   

                  You also need to specify a factory-class in a connector (I don't think you can do this with an http-connector).  Something like this:

                   

                  <connector

                  name="hornetq-connector"

                  factory-class="org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory">

                  <param name="host" value="${remote.hornetq.host}"/>

                  <param name="port" value="5445"/>

                  </connector>