1 Reply Latest reply on Dec 14, 2013 12:26 PM by Justin Bertram

    Jboss 7.1.0 JMS clustering issue

    Murty Kirlampalli Newbie

      I have enabled clustering in one of the environments which is working fine. Servers able to communicate each other with that. We have deployed the builds in another set of environment where broadcasting is failed. So to debug that issue i want to first disable the clustering JMS. I made clustering attribute to false and tried. But still i see brodcast issues. Please help me in this. The following is the XML fragment for JMS in standalone.xml

       

      <subsystem xmlns="urn:jboss:domain:messaging:1.1">

                  <hornetq-server>

                      <clustered>false</clustered>

                      <persistence-enabled>true</persistence-enabled>

                      <security-enabled>false</security-enabled>

                      <journal-file-size>102400</journal-file-size>

                      <journal-min-files>2</journal-min-files>

       

                      <connectors>

                          <netty-connector name="netty" socket-binding="messaging"/>

                          <netty-connector name="netty-throughput" socket-binding="messaging-throughput">

                              <param key="batch-delay" value="50"/>

                          </netty-connector>

                          <in-vm-connector name="in-vm" server-id="0"/>

                      </connectors>

       

                      <acceptors>

                          <netty-acceptor name="netty" socket-binding="messaging"/>

                          <netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">

                              <param key="batch-delay" value="50"/>

                              <param key="direct-deliver" value="false"/>

                          </netty-acceptor>

                          <in-vm-acceptor name="in-vm" server-id="0"/>

                      </acceptors>

       

                      <broadcast-groups>

                          <broadcast-group name="jms-broadcast-group">

                              <group-address>231.7.7.7</group-address>

                              <group-port>9876</group-port>

                              <broadcast-period>100</broadcast-period>

                              <connector-ref>

                                  netty

                              </connector-ref>

                          </broadcast-group>

                      </broadcast-groups>

       

                      <discovery-groups>

                          <discovery-group name="jms-discovery-group">

                              <group-address>231.7.7.7</group-address>

                              <group-port>9876</group-port>

                              <refresh-timeout>10000</refresh-timeout>

                          </discovery-group>

                      </discovery-groups>

       

                      <cluster-connections>

                          <cluster-connection name="jms-cluster">

                              <address>jms</address>

                              <connector-ref>netty</connector-ref>

                              <retry-interval>500</retry-interval>

                              <use-duplicate-detection>true</use-duplicate-detection>

                              <forward-when-no-consumers>true</forward-when-no-consumers>

                              <max-hops>1</max-hops>

                              <discovery-group-ref discovery-group-name="jms-discovery-group"/>

                          </cluster-connection>

                      </cluster-connections>

       

                      <security-settings>

                          <security-setting match="#">

                              <permission type="send" roles="guest"/>

                              <permission type="consume" roles="guest"/>

                              <permission type="createNonDurableQueue" roles="guest"/>

                              <permission type="deleteNonDurableQueue" roles="guest"/>

                          </security-setting>

                      </security-settings>

       

                      <address-settings>

                          <address-setting match="#">

                              <dead-letter-address>jms.queue.DLQ</dead-letter-address>

                              <expiry-address>jms.queue.ExpiryQueue</expiry-address>

                              <redelivery-delay>0</redelivery-delay>

                               <max-size-bytes>10485760</max-size-bytes>

                              <page-size-bytes>10240</page-size-bytes>

                              <address-full-policy>PAGE</address-full-policy>

                              <message-counter-history-day-limit>10</message-counter-history-day-limit>

                          </address-setting>

                      </address-settings>

       

                      <jms-connection-factories>

                          <connection-factory name="InVmConnectionFactory">

                              <discovery-group-ref discovery-group-name="jms-discovery-group"/>

                              <connectors>

                                  <connector-ref connector-name="netty"/>

                              </connectors>

                              <entries>

                                  <entry name="java:/ConnectionFactory"/>

                                  <entry name="java:jboss/exported/ConnectionFactory"/>

                              </entries>

                          </connection-factory>

                          <connection-factory name="RemoteConnectionFactory">

                              <connectors>

                                  <connector-ref connector-name="netty"/>

                              </connectors>

                              <entries>

                                  <entry name="java:/RemoteConnectionFactory"/>

                                  <entry name="java:jboss/exported/RemoteConnectionFactory"/>

                              </entries>

                          </connection-factory>

                          <pooled-connection-factory name="hornetq-ra">

                              <transaction mode="xa"/>

                              <connectors>

                                  <connector-ref connector-name="in-vm"/>

                              </connectors>

                              <entries>

                                  <entry name="java:/JmsXA"/>

                                  <entry name="java:jboss/exported/JmsXA"/>

                              </entries>

                          </pooled-connection-factory>

                      </jms-connection-factories>

       

                      <jms-destinations>

                          <jms-queue name="AndroidAppQueue">

                              <entry name="queue/AndroidAppQueue"/>

                              <entry name="java:jboss/exported/queue/AndroidAppQueue"/>

                          </jms-queue>

                          <jms-queue name="BlackBerryAppQueue">

                              <entry name="queue/BlackBerryAppQueue"/>

                              <entry name="java:jboss/exported/queue/BlackBerryAppQueue"/>

                          </jms-queue>

                          <jms-queue name="IOSAppQueue">

                              <entry name="queue/IOSAppQueue"/>

                              <entry name="java:jboss/exported/queue/IOSAppQueue"/>

                          </jms-queue>

                          <jms-queue name="AppAnalysis">

                              <entry name="queue/AppAnalysis"/>

                              <entry name="java:jboss/exported/queue/AppAnalysis"/>

                          </jms-queue>

                      </jms-destinations>

                  </hornetq-server>

              </subsystem>

       

      When i send the messages, i get the following errors :

       

      22:18:33,442 INFO  [com.asurion.parasol.cloudav.

      thread.QueueAppRunnable] (pool-17-thread-1) Running QueueAppRunnable.run()
      22:18:33,448 INFO  [com.asurion.parasol.cloudav.thread.QueueAppRunnable] (pool-17-thread-1) Queuing app with hash 004079c406e1b31a4b676fc5d655746d
      22:18:36,850 DEBUG [com.asurion.parasol.cloudav.util.FileUtils] (pool-17-thread-1) DeleteTMP: Deleting file/opt/msp/.cache/beach7939891662516784246tmp
      22:18:36,895 DEBUG [com.asurion.parasol.cloudav.dao.impl.CassandraDao] (pool-17-thread-1) Adding audit entry for hash 004079c406e1b31a4b676fc5d655746d
      22:18:36,903 DEBUG [com.asurion.parasol.cloudav.jms.JmsUtil] (pool-17-thread-1) Sending message (004079c406e1b31a4b676fc5d655746d) to queue/AndroidAppQueue
      22:18:36,906 ERROR [com.asurion.parasol.cloudav.jms.JmsUtil] (pool-17-thread-1) Failed to create session factory: javax.jms.JMSException: Failed to create session factory


           at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:605)
          at org.hornetq.jms.client.HornetQConnectionFactory.createQueueConnection(HornetQConnectionFactory.java:131)
           at org.hornetq.jms.client.HornetQConnectionFactory.createQueueConnection(HornetQConnectionFactory.java:126)
          at com.asurion.parasol.cloudav.jms.JmsUtil.createConnection(JmsUtil.java:45) [restapi-2.0-SNAPSHOT.jar:]
           at com.asurion.parasol.cloudav.jms.JmsUtil.sendMessage(JmsUtil.java:213) [restapi-2.0-SNAPSHOT.jar:]
          at com.asurion.parasol.cloudav.thread.QueueAppRunnable.queueApp(QueueAppRunnable.java:161) [restapi-2.0-SNAPSHOT.jar:]
           at com.asurion.parasol.cloudav.thread.QueueAppRunnable.run(QueueAppRunnable.java:68) [restapi-2.0-SNAPSHOT.jar:]
          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_25]
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_25]
          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25]
      Caused by: HornetQException[errorCode=3 message=Timed out waiting to receive initial broadcast from cluster]
           at org.hornetq.core.client.impl.ServerLocatorImpl.createSessionFactory(ServerLocatorImpl.java:711)
          at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:601)
           ... 9 more
      My questions is to disable clustering, any other settings need to be done in stanalone.xml other than "<clustered>false</clustered>"
      Thanks
      Murty
        • 1. Re: Jboss 7.1.0 JMS clustering issue
          Justin Bertram Master

          What connection factory are you using when the exception is thrown?  Are you using ConnectionFactory?  If so, it is configured to use a discovery group:

           

                              <connection-factory name="InVmConnectionFactory">

                                  <discovery-group-ref discovery-group-name="jms-discovery-group"/>

                                  <connectors>

                                      <connector-ref connector-name="netty"/>

                                  </connectors>

                                  <entries>

                                      <entry name="java:/ConnectionFactory"/>

                                      <entry name="java:jboss/exported/ConnectionFactory"/>

                                  </entries>

                              </connection-factory>

           

          If you don't want to use clustering then you shouldn't have a connection factory configured with a discovery group.

           

          Also, the RemoteConnectionFactory is generally the only one which is in the "exported" JNDI namespace.  It doesn't really make sense for the "InVmConnectionFactory" to be exported since it is, by definition, in-vm, and a <pooled-connection-factory> can't be used by a remote client at all because it is JCA based.