5 Replies Latest reply on Aug 15, 2012 2:36 PM by Himanshu Gupta

    MDB configuration to connect to clustered JMS topic

    Himanshu Gupta Newbie

      Hi,

       

      We have setup a cluster of JBoss AS7 nodes to work as JMS cluster via Hornetq. This cluster works fine when connected via a remote JNDI client and clustering works fine. Remote client is able to connect to send messages to the JMS topic deployed in the JMS cluster.

       

      Now we are configuring a MDB on a new JBoss AS7 node listening to a JMS topic deployed on the JMS cluster - but we are not able to figure out how to configure MDB EAR configuration so that it is aware of the JMS cluster available.

       

      If we configure either of the JMS cluster node in MDB EAR configuration as a single JMS node, MDB works fine. We are able to do this by configuring connectionParams pointing the JMS node server and the port 5445. But we are not able to figure how to configure the cluster with both the nodes in MDB configuration.

       

      We gave a comma separated list of connectionParams e.g. host=abc.xyz.com;port=5445,host=def.xyz.com;port=5445 but the JBoss node on which we are deploying MDB kept complainig awaiting for topic/queue creation errror.

       

      We are kind of stuck here for some time and unable to move forward - any help will be greatly appreciated.

       

      Thanks,

      Himanshu

        • 1. Re: MDB configuration to connect to clustered JMS topic
          Justin Bertram Master

          How about using discovery?  Something like this on your MDB:

           

                  @ActivationConfigProperty(propertyName = "connectorClassName", propertyValue = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"),
                  @ActivationConfigProperty(propertyName = "reconnectAttempts", propertyValue = "-1"),
                  @ActivationConfigProperty(propertyName = "setupAttempts", propertyValue = "-1"),
                  @ActivationConfigProperty(propertyName = "discoveryAddress", propertyValue = "231.7.7.7"),
                  @ActivationConfigProperty(propertyName = "discoveryPort", propertyValue = "9876")})
          
          1 of 1 people found this helpful
          • 2. Re: MDB configuration to connect to clustered JMS topic
            Himanshu Gupta Newbie

            Hi Justin,

             

            Thanks a lot for the response. Using the discovery address, my MDB is able to connect to the cluster and listen for JMS messages.

             

            But I am seeing one problem - if I start my complete setup with MDB JBoss node and JMS cluster nodes (there are two hornetq nodes in cluster) and my remote client publishing JMS messages to the topic, complete flow passes. I can see the messages coming to my MDB. After this I stop one hornetq node (nodeA) in my  cluster and I still see MDB listening to messages and getting called. When I restart hornetq nodeA again and stop hornetq nodeB now, MDB stops listening to the messages. My remote client is still able to publish messages properly which means hornetq node A is working fine.

             

            Can you please provide some pointers for this?

             

            ******

            Did some more analysis of the logs from the node where MDB is deployed - it seems MDB JBoss node connects to first hornetQ cluster node as soon as it up. See the following log snippet from MDB Jboss node where 10.10.16.129 is my node A of hornetQ cluster on port 5545:

            14:36:51,046 DEBUG [org.hornetq.ra.inflow.HornetQActivation] (default-threads - 1) Using queue connection DelegatingSession [session=ClientSessionImpl [name=0136903f-dc21-11e1-a972

            -9bc6f00bc34f, username=null, closed=false, factory = ClientSessionFactoryImpl [serverLocator=ServerLocatorImpl [initialConnectors=[org-hornetq-core-remoting-impl-netty-NettyConnec

            torFactory?port=5545&host=10-10-16-129], discoveryGroupConfiguration=DiscoveryGroupConfiguration [discoveryInitialWaitTimeout=10000, groupAddress=231.7.7.7, groupPort=9876, localBi

            ndAddress=null, name=fbdc52e8-dc20-11e1-a972-9bc6f00bc34f, refreshTimeout=10000]], connectorConfig=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5545&host=10-10-1

            6-129, backupConfig=null], metaData=(jms-client-id=MDBServer,resource-adapter=inbound,jms-session=,)]@28024b7b]

             

            When I start second node in the HornetQ cluster, that is also registered as node in MDB JBoss node. See the following log snippet from MDB Jboss node where 10.10.16.129 is my node B of hornetQ cluster on port 5645:

            14:37:59,755 DEBUG [org.hornetq.core.client.impl.ServerLocatorImpl] (Thread-27 (HornetQ-client-global-threads-1688979363)) NodeUp ServerLocatorImpl [initialConnectors=[org-hornetq-

            core-remoting-impl-netty-NettyConnectorFactory?port=5545&host=10-10-16-129], discoveryGroupConfiguration=DiscoveryGroupConfiguration [discoveryInitialWaitTimeout=10000, groupAddres

            s=231.7.7.7, groupPort=9876, localBindAddress=null, name=fbdc52e8-dc20-11e1-a972-9bc6f00bc34f, refreshTimeout=10000]]::nodeID=736cf9f6-dc0e-11e1-9ed1-63aff85de1d1, connectorPair=Pa

            ir[a=org-hornetq-core-remoting-impl-netty-NettyConnectorFactory?port=5645&host=10-10-16-129, b=null]:

             

            Now when I stop my node A of HornetQ cluster, it seems MDB JBoss node makes all reconnect attempts to Node A of hornetQ cluster only and never tries to connect to node B of hornet Q cluster:

            14:39:07,867 DEBUG [org.hornetq.core.remoting.impl.netty.NettyConnector] (Thread-35 (HornetQ-client-global-threads-1688979363)) Started Netty Connector version 3.2.5.Final-a96d88c

            14:39:07,848 DEBUG [org.hornetq.core.client.impl.ClientSessionFactoryImpl] (Thread-51 (HornetQ-client-global-threads-1688979363)) Trying to connect with connector = org.hornetq.cor

            e.remoting.impl.netty.NettyConnectorFactory@79ab5825, parameters = {port=5545, host=10.10.16.129} connector = NettyConnector [host=10.10.16.129, port=5545, httpEnabled=false, useSe

            rvlet=false, servletPath=/messaging/HornetQServlet, sslEnabled=false, useNio=false]

             

             

            Thanks,

            Himanshu

            • 3. Re: MDB configuration to connect to clustered JMS topic
              Himanshu Gupta Newbie

              I am still struggling here.

               

              With multiple combinations tried - it seems the best I am able to achieve is that JBoss AS 7 MDB server only connects to one server in the cluster and wait till that server for that server to come up if its been stopped. It seems it never connects to the second node in JBoss AS 7 HornetQ cluster.

              • 4. Re: MDB configuration to connect to clustered JMS topic
                Nicholas DiPiazza Novice

                I spoke with Justin Bertram over IRC.

                 

                Me: i am hoping to find a simple comma separated list of connectionParams e.g. host=abc.xyz.com;port=5445,host=def.xyz.com;port=5445

                 

                Justin: that should be possible

                when you use the comma separated list did you have a comma separated list of transport class names also?

                 

                Me: I will check this.

                 

                Himanshu, are you supplying the comma separated list of transport class names as well?

                 

                - Nicholas DiPiazza

                Open Logic OSS Support Engineer

                • 5. Re: MDB configuration to connect to clustered JMS topic
                  Himanshu Gupta Newbie

                  Hi Nicholas,

                   

                  Yes, using comma separalted list.

                   

                  Linking the post where second discussion happening: https://community.jboss.org/message/753824?_sscc=t#753824

                   

                  Thanks,

                  Himanshu