6 Replies Latest reply on Jul 23, 2014 12:35 PM by anuradhap

    How to cluster the HornetQ with MDB using 7.1

    only1kairi

      Hi, I built a full-ha profile server with serveral nodes but when I run a large job the places items on a queue, only the MDBs on the one node are responding to the Queue. How can I spread the messages to the other nodes?

       

      Thanks in advance

        • 1. Re: How to cluster the HornetQ with MDB using 7.1
          markus78

          Hi,

           

          Make sure <clustered>true</clustered> is set in your hornetq settings and then add the connectors the node needs to know about ( unless you want the server to auto discover the others, look in the hornetq doc's for howto's )

           

          So define X number of connectors to all other servers in the cluster

           

          <connector name="this_server_connector">
          <factory-class>
               org.hornetq.core.remoting.impl.netty.NettyConnectorFactory
          </factory-class>
          <param key="host" value="localhost"/>
          <param key="port" value="5445"/> 
          </connector>
          
          
          
          
          <connector name="other-server">
          <factory-class>
               org.hornetq.core.remoting.impl.netty.NettyConnectorFactory
          </factory-class>
          <param key="host" value="other.server.ip"/>
          <param key="port" value="5445"/> 
          </connector>
          
          
          

           


           

          Then define the cluster itself

           

          <cluster-connections>
                              <cluster-connection name="my-cluster">
                                  <address>
                                      jms
                                  </address>
                                  <connector-ref>
                                      this_server_connector
                                  </connector-ref>
                                  <retry-interval>
                                      5000
                                  </retry-interval>
                                  <use-duplicate-detection>
                                      true
                                  </use-duplicate-detection>
                                  <forward-when-no-consumers>
                                      false
                                  </forward-when-no-consumers>
                                  <max-hops>
                                      1
                                  </max-hops>
                                  <static-connectors>
                                      <connector-ref>
                                          other_server
                                      </connector-ref>
                                      <connector-ref>
                                                                           more_server_connectors     
          
                                      </connector-ref>
                                  </static-connectors>
                              </cluster-connection>
                          </cluster-connections>
          
          

           

          Note the "this_server_connector" that's a connector defined for the localhost.

          There is more info on each of the tag's in the hornetq docs!

          • 2. Re: How to cluster the HornetQ with MDB using 7.1
            only1kairi

            This does not work, everytime I tried it I get the following error.

             

            [Server:blah-manager-server] 19:05:50,030 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 10) Operation ("add") failed - address: ([

            [Server:blah-manager-server]     ("subsystem" => "messaging"),

            [Server:blah-manager-server]     ("hornetq-server" => "default"),

            [Server:blah-manager-server]     ("connector" => "this_server_connector")

            [Server:blah-manager-server] ]) - failure description: "JBAS014746: factory-class may not be null"

            • 3. Re: How to cluster the HornetQ with MDB using 7.1
              lgangloff

              I have the same problem...

              Whan i add this configuration in standalone mode, there is not error:

               

              <connector name="connector">
              <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>
              <param key="host" value="192.168.1.2"/>
              <param key="port" value="5445"/>
              </connector>

               

              But in domain mode, i get the same error:

               

              [Server:n-a] 16:17:57,467 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 8) Operation ("add") failed - address: ([

              [Server:n-a]     ("subsystem" => "messaging"),

              [Server:n-a]     ("hornetq-server" => "default"),

              [Server:n-a]     ("connector" => "connector")

              [Server:n-a] ]) - failure description: "JBAS014746: factory-class may not be null"

               

               

              any idea ?

              • 4. Re: How to cluster the HornetQ with MDB using 7.1
                ctomc

                Hi,

                 

                if it works in standalone but not in domain mode it sound like a bug.

                please file a jira issue so it can be tracked and fixed.

                 

                tnx,

                tomaz

                • 5. Re: How to cluster the HornetQ with MDB using 7.1
                  only1kairi

                  Thanks Tomaz, does anyone have a quick hack?

                   

                  It will probably be sometime before this is resolved.

                   

                  And I submitted a bug.

                  • 6. Re: How to cluster the HornetQ with MDB using 7.1
                    anuradhap

                    Hi,

                    Any solution to this problem? I'm trying to use a different connector for sending jms messages to a remote host, that is in a clustered server. Here is my domain.xml for the same:

                    <connection-factory name="RemoteConnectionFactory">

                                                <connectors>

                                                    <connector-ref connector-name="remote-jms"/>

                                                </connectors>

                                                <entries>

                                                    <entry name="RemoteConnectionFactory"/>

                                                </entries>

                                            </connection-factory>

                     

                    <connector name="remote-jms">

                              <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class>

                               <param key="host" value="myHost"/>

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

                         </connector>