13 Replies Latest reply on Jul 20, 2016 3:27 AM by Miroslav Novak

    HornetQ live and backup on the same server.

    Jay Tommy Newbie

      I am trying to setup a 2 live/backup configuration.

       

      1.png

       

       

      So on VM1, I have 1 JBoss that is supposed to run a HornetQ Live server and a Backup server serving a Live server on another JBoss(another VM).

       

      Right now my config for Live server is :

       

                  <hornetq-server name="live">

                      <cluster-password>Ike28LLtq</cluster-password>

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

                      <backup>false</backup>

                      <failover-on-shutdown>true</failover-on-shutdown>

                      <shared-store>true</shared-store>

       

       

                      <journal-type>NIO</journal-type>

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

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

       

       

                      <paging-directory path="../../../../../../share/pel/paging"/>

                      <bindings-directory path="../../../../../../share/pel/bindings"/>

                      <journal-directory path="../../../../../../share/pel/journal"/>

                      <large-messages-directory path="../../../../../../share/pel/largemessages"/>

       

       

                      <connectors>

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

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

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

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

                          </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="host" value="172.16.1.22"/>

                              <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="bg-group1">

                              <socket-binding>messaging-group</socket-binding>

                              <broadcast-period>5000</broadcast-period>

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

                          </broadcast-group>

                      </broadcast-groups>

       

       

                      <discovery-groups>

                          <discovery-group name="dg-group1">

                              <socket-binding>messaging-group</socket-binding>

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

                          </discovery-group>

                      </discovery-groups>

       

       

                      <cluster-connections>

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

                              <address>jms</address>

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

                              <discovery-group-ref discovery-group-name="dg-group1"/>

                          </cluster-connection>

                      </cluster-connections>

       

       

                      <security-settings>

                          <security-setting match="#">

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

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

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

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

                          </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>

                              <redistribution-delay>1000</redistribution-delay>

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

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

                              <page-size-bytes>2097152</page-size-bytes>

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

                          </address-setting>

                      </address-settings>

       

       

                      <jms-connection-factories>

                          <connection-factory name="InVmConnectionFactory">

                              <connectors>

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

                              </connectors>

                              <entries>

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

                              </entries>

                          </connection-factory>

                          <connection-factory name="RemoteConnectionFactory">

                              <connectors>

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

                              </connectors>

                              <entries>

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

                              </entries>

                              <ha>true</ha>

                              <block-on-acknowledge>true</block-on-acknowledge>

                              <retry-interval>1000</retry-interval>

                              <retry-interval-multiplier>1.0</retry-interval-multiplier>

                              <reconnect-attempts>-1</reconnect-attempts>

                          </connection-factory>

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

                              <transaction mode="xa"/>

                              <connectors>

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

                              </connectors>

                              <entries>

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

                              </entries>

                          </pooled-connection-factory>

                      </jms-connection-factories>

       

       

                      <jms-destinations>

                          <jms-queue name="PELQueue">

                              <entry name="queue/PELQueue"/>

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

                          </jms-queue>

                      </jms-destinations>

                  </hornetq-server>

       

       

       

      Within the same standalone.xml file, I have defined the Backup server too:

       

      <hornetq-server name="backup2">

                      <cluster-password>Ike28LLtq</cluster-password>

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

                      <backup>true</backup>

                      <failover-on-shutdown>true</failover-on-shutdown>

                      <shared-store>true</shared-store>

       

       

                      <journal-type>NIO</journal-type>

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

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

       

       

                      <paging-directory path="../../../../../../share/pel2/paging"/>

                      <bindings-directory path="../../../../../../share/pel2/bindings"/>

                      <journal-directory path="../../../../../../share/pel2/journal"/>

                      <large-messages-directory path="../../../../../../share/pel2/largemessages"/>

       

       

                      <connectors>

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

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

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

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

                          </netty-connector>

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

                      </connectors>

       

       

                      <acceptors>

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

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

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

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

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

                          </netty-acceptor>

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

                      </acceptors>

       

       

                      <broadcast-groups>

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

                              <socket-binding>messaging-group</socket-binding>

                              <broadcast-period>5000</broadcast-period>

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

                          </broadcast-group>

                      </broadcast-groups>

       

       

                      <discovery-groups>

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

                              <socket-binding>messaging-group</socket-binding>

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

                          </discovery-group>

                      </discovery-groups>

       

       

                      <cluster-connections>

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

                              <address>jms</address>

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

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

                          </cluster-connection>

                      </cluster-connections>

       

       

                      <security-settings>

                          <security-setting match="#">

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

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

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

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

                          </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>

                              <redistribution-delay>1000</redistribution-delay>

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

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

                              <page-size-bytes>2097152</page-size-bytes>

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

                          </address-setting>

                      </address-settings>

       

       

                      <jms-connection-factories>

                          <connection-factory name="InVmConnectionFactory">

                              <connectors>

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

                              </connectors>

                              <entries>

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

                              </entries>

                          </connection-factory>

                          <connection-factory name="RemoteConnectionFactory">

                              <connectors>

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

                              </connectors>

                              <entries>

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

                              </entries>

                              <ha>true</ha>

                              <block-on-acknowledge>true</block-on-acknowledge>

                              <retry-interval>1000</retry-interval>

                              <retry-interval-multiplier>1.0</retry-interval-multiplier>

                              <reconnect-attempts>-1</reconnect-attempts>

                          </connection-factory>

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

                              <transaction mode="xa"/>

                              <connectors>

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

                              </connectors>

                              <entries>

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

                              </entries>

                          </pooled-connection-factory>

                      </jms-connection-factories>

       

       

                      <jms-destinations>

                          <jms-queue name="PELQueue">

                              <entry name="queue/PELQueue"/>

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

                          </jms-queue>

                      </jms-destinations>

                  </hornetq-server>

       

       

      When I start JBoss, I get the ERROR:

       

      2016-07-12 12:14:38,576| ERROR [org.hornetq.core.server.impl.HornetQServerImpl$SharedStoreBackupActivation] (HQ119000: Activation for server HornetQServerImpl::serverUUID=ebb1ced7-4854-11e6-bcaa-099bc9fcea0d)|HQ224000: Failure in initialisation: org.jboss.netty.channel.ChannelException: Failed to bind to: /10.174.72.24:5492

        at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272)

        at org.hornetq.core.remoting.impl.netty.NettyAcceptor.startServerChannels(NettyAcceptor.java:553)

        at org.hornetq.core.remoting.impl.netty.NettyAcceptor.start(NettyAcceptor.java:511)

        at org.hornetq.core.remoting.server.impl.RemotingServiceImpl.start(RemotingServiceImpl.java:262)

        at org.hornetq.core.server.impl.HornetQServerImpl.initialisePart2(HornetQServerImpl.java:1657)

        at org.hornetq.core.server.impl.HornetQServerImpl.access$1400(HornetQServerImpl.java:179)

        at org.hornetq.core.server.impl.HornetQServerImpl$SharedStoreBackupActivation.run(HornetQServerImpl.java:2370)

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

      Caused by: java.net.BindException: Address already in use

       

      Is it possible to have both the Live and Backup server running on the same PORT ?

        • 1. Re: HornetQ live and backup on the same server.
          Hao Wu Newbie

          Hi Jay,

           

          Can you send the entire EAP config XML?  Port 5492 is not a default port for anything HornetQ related.  Did you make any changes to the default ports?

           

          Thanks,

          Hao

          • 2. Re: HornetQ live and backup on the same server.
            Miroslav Novak Master

            Hi Jay,

             

            It's not possible to have live and backup2 on the same port. For acceptors in backup2 server you will need to create socket binding with different ports than for live server.

             

            It's not possible due to practical reasons as backup2 will activate once messaging VM 2 server is killed/shutdown. All clients will failover from live messaging VM 2 to backup2 in messaging VM 1.

             

            HornetQ clients cannot failover from live to live server. They always failover from live to backup.

             

            I have note to your config:

            - from backup2 you should remove everything what's trying to register something to JNDI. Those are all connection factories and jms destinations. This is bacause that after failover when backup2 activates, it will try to register them to JNDI.

            - you should add attribute allow-failback and set it true if you want backup2 in messaging VM 1 to deactivate when messaging VM 2 is started again.

             

            I'm attaching configuration which is used in our tests - it will help you to configure it properly:

            Server 1:

                <subsystem xmlns="urn:jboss:domain:messaging:1.4">
                    <hornetq-server>
                        <persistence-enabled>true</persistence-enabled>
                        <security-enabled>false</security-enabled>
                        <cluster-password>CHANGE_ME!!!</cluster-password>
                        <failover-on-shutdown>true</failover-on-shutdown>
                        <shared-store>true</shared-store>
                        <journal-type>ASYNCIO</journal-type>
                        <journal-file-size>10485760</journal-file-size>
                        <journal-min-files>2</journal-min-files>
                        <paging-directory path="../../../../hornetq-journal-A/messagingpaging"/>
                        <bindings-directory path="../../../../hornetq-journal-A/messagingbindings"/>
                        <journal-directory path="../../../../hornetq-journal-A/messagingjournal"/>
                        <large-messages-directory path="../../../../hornetq-journal-A/mesaaginglargemessages"/>

             

                        <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="bg-group1">
                                <socket-binding>messaging-group</socket-binding>
                                <broadcast-period>2000</broadcast-period>
                                <connector-ref>
                                    netty
                                </connector-ref>
                            </broadcast-group>
                        </broadcast-groups>

             

                        <discovery-groups>
                            <discovery-group name="dg-group1">
                                <socket-binding>messaging-group</socket-binding>
                                <refresh-timeout>10000</refresh-timeout>
                            </discovery-group>
                        </discovery-groups>

             

                        <cluster-connections>
                            <cluster-connection name="my-cluster">
                                <address>jms</address>
                                <connector-ref>netty</connector-ref>
                                <retry-interval>1000</retry-interval>
                                <use-duplicate-detection>true</use-duplicate-detection>
                                <forward-when-no-consumers>false</forward-when-no-consumers>
                                <max-hops>1</max-hops>
                                <discovery-group-ref discovery-group-name="dg-group1"/>
                            </cluster-connection>
                        </cluster-connections>

             

                        <security-settings>
                            <security-setting match="#">
                                <permission type="send" roles="guest"/>
                                <permission type="consume" roles="guest"/>
                                <permission type="createDurableQueue" roles="guest"/>
                                <permission type="deleteDurableQueue" roles="guest"/>
                                <permission type="createNonDurableQueue" roles="guest"/>
                                <permission type="deleteNonDurableQueue" roles="guest"/>
                                <permission type="manage" roles="guest"/>
                            </security-setting>
                        </security-settings>

             

                        <address-settings>
                            <address-setting match="#">
                                <redelivery-delay>0</redelivery-delay>
                                <max-delivery-attempts>200</max-delivery-attempts>
                                <max-size-bytes>1048576</max-size-bytes>
                                <page-size-bytes>524288</page-size-bytes>
                                <address-full-policy>PAGE</address-full-policy>
                                <redistribution-delay>0</redistribution-delay>
                            </address-setting>
                        </address-settings>

             

                        <jms-connection-factories>
                            <connection-factory name="InVmConnectionFactory">
                                <connectors>
                                    <connector-ref connector-name="in-vm"/>
                                </connectors>
                                <entries>
                                    <entry name="java:/ConnectionFactory"/>
                                </entries>
                            </connection-factory>
                            <connection-factory name="RemoteConnectionFactory">
                                <connectors>
                                    <connector-ref connector-name="netty"/>
                                </connectors>
                                <entries>
                                    <entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
                                </entries>
                                <ha>true</ha>
                                <block-on-acknowledge>true</block-on-acknowledge>
                                <retry-interval>1000</retry-interval>
                                <retry-interval-multiplier>1.0</retry-interval-multiplier>
                                <reconnect-attempts>-1</reconnect-attempts>
                                <failover-on-server-shutdown>true</failover-on-server-shutdown>
                            </connection-factory>
                            <pooled-connection-factory name="hornetq-ra">
                                <transaction mode="xa"/>
                                <connectors>
                                    <connector-ref connector-name="in-vm"/>
                                </connectors>
                                <entries>
                                    <entry name="java:/JmsXA"/>
                                </entries>
                                <ha>true</ha>
                                <block-on-acknowledge>true</block-on-acknowledge>
                                <reconnect-attempts>-1</reconnect-attempts>
                            </pooled-connection-factory>
                        </jms-connection-factories>

             

                        <jms-destinations>
                            <jms-queue name="ExpiryQueue">
                                <entry name="java:/jms/queue/ExpiryQueue"/>
                            </jms-queue>
                            <jms-queue name="DLQ">
                                <entry name="java:/jms/queue/DLQ"/>
                            </jms-queue>
                            <jms-queue name="testQueue0">
                                <entry name="jms/queue/testQueue0"/>
                                <entry name="java:jboss/exported/jms/queue/testQueue0"/>
                                <durable>true</durable>
                            </jms-queue>
                            <jms-queue name="InQueue">
                                <entry name="jms/queue/InQueue"/>
                                <entry name="java:jboss/exported/jms/queue/InQueue"/>
                                <durable>true</durable>
                            </jms-queue>
                            <jms-queue name="OutQueue">
                                <entry name="jms/queue/OutQueue"/>
                                <entry name="java:jboss/exported/jms/queue/OutQueue"/>
                                <durable>true</durable>
                            </jms-queue>
                            <jms-topic name="testTopic0">
                                <entry name="jms/topic/testTopic0"/>
                                <entry name="java:jboss/exported/jms/topic/testTopic0"/>
                            </jms-topic>
                        </jms-destinations>
                    </hornetq-server>
                    <hornetq-server name="backup">
                        <persistence-enabled>true</persistence-enabled>
                        <security-enabled>false</security-enabled>
                        <cluster-password>CHANGE_ME!!!</cluster-password>
                        <backup>true</backup>
                        <allow-failback>true</allow-failback>
                        <failover-on-shutdown>true</failover-on-shutdown>
                        <shared-store>true</shared-store>
                        <journal-type>ASYNCIO</journal-type>
                        <journal-file-size>10485760</journal-file-size>
                        <paging-directory path="../../../../hornetq-journal-B/messagingpaging"/>
                        <bindings-directory path="../../../../hornetq-journal-B/messagingbindings"/>
                        <journal-directory path="../../../../hornetq-journal-B/messagingjournal"/>
                        <large-messages-directory path="../../../../hornetq-journal-B/mesaaginglargemessages"/>

             

                        <connectors>
                            <netty-connector name="netty-backup" socket-binding="messaging-backup"/>
                            <in-vm-connector name="in-vm" server-id="0"/>
                        </connectors>

             

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

             

                        <broadcast-groups>
                            <broadcast-group name="bg-group-backup">
                                <socket-binding>messaging-group</socket-binding>
                                <broadcast-period>2000</broadcast-period>
                                <connector-ref>
                                    netty-backup
                                </connector-ref>
                            </broadcast-group>
                        </broadcast-groups>

             

                        <discovery-groups>
                            <discovery-group name="dg-group-backup">
                                <socket-binding>messaging-group</socket-binding>
                                <refresh-timeout>10000</refresh-timeout>
                            </discovery-group>
                        </discovery-groups>

             

                        <cluster-connections>
                            <cluster-connection name="my-cluster">
                                <address>jms</address>
                                <connector-ref>netty-backup</connector-ref>
                                <retry-interval>1000</retry-interval>
                                <use-duplicate-detection>true</use-duplicate-detection>
                                <forward-when-no-consumers>false</forward-when-no-consumers>
                                <max-hops>1</max-hops>
                                <discovery-group-ref discovery-group-name="dg-group-backup"/>
                            </cluster-connection>
                        </cluster-connections>

             

                        <security-settings>
                            <security-setting match="#">
                                <permission type="send" roles="guest"/>
                                <permission type="consume" roles="guest"/>
                                <permission type="createDurableQueue" roles="guest"/>
                                <permission type="deleteDurableQueue" roles="guest"/>
                                <permission type="createNonDurableQueue" roles="guest"/>
                                <permission type="deleteNonDurableQueue" roles="guest"/>
                                <permission type="manage" roles="guest"/>
                            </security-setting>
                        </security-settings>

             

                        <address-settings>
                            <address-setting match="#">
                                <redelivery-delay>0</redelivery-delay>
                                <max-delivery-attempts>200</max-delivery-attempts>
                                <max-size-bytes>1048576</max-size-bytes>
                                <page-size-bytes>524288</page-size-bytes>
                                <address-full-policy>PAGE</address-full-policy>
                                <redistribution-delay>0</redistribution-delay>
                            </address-setting>
                        </address-settings>

            </hornetq-server>

            </subsystem>

            ...  
            <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">
               ...
                <socket-binding name="messaging" port="5445"/>
                <socket-binding name="messaging-group" port="0" multicast-address="${jboss.messaging.group.address:231.7.7.7}" multicast-port="${jboss.messaging.group.port:9876}"/>
                <socket-binding name="messaging-throughput" port="5455"/>
                <socket-binding name="messaging-backup" port="5446"/>

                ...

            </socket-binding-group>

             

            Server 2

             

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

                        <hornetq-server>

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

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

                            <cluster-password>CHANGE_ME!!!</cluster-password>

                            <failover-on-shutdown>true</failover-on-shutdown>

                            <shared-store>true</shared-store>

                            <journal-type>ASYNCIO</journal-type>

                            <journal-file-size>10485760</journal-file-size>

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

                            <paging-directory path="../../../../hornetq-journal-B/messagingpaging"/>

                            <bindings-directory path="../../../../hornetq-journal-B/messagingbindings"/>

                            <journal-directory path="../../../../hornetq-journal-B/messagingjournal"/>

                            <large-messages-directory path="../../../../hornetq-journal-B/mesaaginglargemessages"/>

             

                            <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="bg-group1">

                                    <socket-binding>messaging-group</socket-binding>

                                    <broadcast-period>2000</broadcast-period>

                                    <connector-ref>

                                        netty

                                    </connector-ref>

                                </broadcast-group>

                            </broadcast-groups>

             

                            <discovery-groups>

                                <discovery-group name="dg-group1">

                                    <socket-binding>messaging-group</socket-binding>

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

                                </discovery-group>

                            </discovery-groups>

             

                            <cluster-connections>

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

                                    <address>jms</address>

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

                                    <retry-interval>1000</retry-interval>

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

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

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

                                    <discovery-group-ref discovery-group-name="dg-group1"/>

                                </cluster-connection>

                            </cluster-connections>

             

                            <security-settings>

                                <security-setting match="#">

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

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

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

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

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

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

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

                                </security-setting>

                            </security-settings>

             

                            <address-settings>

                                <address-setting match="#">

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

                                    <max-delivery-attempts>200</max-delivery-attempts>

                                    <max-size-bytes>1048576</max-size-bytes>

                                    <page-size-bytes>524288</page-size-bytes>

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

                                    <redistribution-delay>0</redistribution-delay>

                                </address-setting>

                            </address-settings>

             

                            <jms-connection-factories>

                                <connection-factory name="InVmConnectionFactory">

                                    <connectors>

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

                                    </connectors>

                                    <entries>

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

                                    </entries>

                                </connection-factory>

                                <connection-factory name="RemoteConnectionFactory">

                                    <connectors>

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

                                    </connectors>

                                    <entries>

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

                                    </entries>

                                    <ha>true</ha>

                                    <block-on-acknowledge>true</block-on-acknowledge>

                                    <retry-interval>1000</retry-interval>

                                    <retry-interval-multiplier>1.0</retry-interval-multiplier>

                                    <reconnect-attempts>-1</reconnect-attempts>

                                    <failover-on-server-shutdown>true</failover-on-server-shutdown>

                                </connection-factory>

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

                                    <transaction mode="xa"/>

                                    <connectors>

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

                                    </connectors>

                                    <entries>

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

                                    </entries>

                                    <ha>true</ha>

                                    <block-on-acknowledge>true</block-on-acknowledge>

                                    <reconnect-attempts>-1</reconnect-attempts>

                                </pooled-connection-factory>

                            </jms-connection-factories>

             

                            <jms-destinations>

                                <jms-queue name="ExpiryQueue">

                                    <entry name="java:/jms/queue/ExpiryQueue"/>

                                </jms-queue>

                                <jms-queue name="DLQ">

                                    <entry name="java:/jms/queue/DLQ"/>

                                </jms-queue>

                                <jms-queue name="testQueue0">

                                    <entry name="jms/queue/testQueue0"/>

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

                                    <durable>true</durable>

                                </jms-queue>

                                <jms-queue name="InQueue">

                                    <entry name="jms/queue/InQueue"/>

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

                                    <durable>true</durable>

                                </jms-queue>

                                <jms-queue name="OutQueue">

                                    <entry name="jms/queue/OutQueue"/>

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

                                    <durable>true</durable>

                                </jms-queue>

                                <jms-topic name="testTopic0">

                                    <entry name="jms/topic/testTopic0"/>

                                    <entry name="java:jboss/exported/jms/topic/testTopic0"/>

                                </jms-topic>

                            </jms-destinations>

                        </hornetq-server>

                        <hornetq-server name="backup">

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

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

                            <cluster-password>CHANGE_ME!!!</cluster-password>

                            <backup>true</backup>

                            <allow-failback>true</allow-failback>

                            <failover-on-shutdown>true</failover-on-shutdown>

                            <shared-store>true</shared-store>

                            <journal-type>ASYNCIO</journal-type>

                            <journal-file-size>10485760</journal-file-size>

                            <paging-directory path="../../../../hornetq-journal-A/messagingpaging"/>

                            <bindings-directory path="../../../../hornetq-journal-A/messagingbindings"/>

                            <journal-directory path="../../../../hornetq-journal-A/messagingjournal"/>

                            <large-messages-directory path="../../../../hornetq-journal-A/mesaaginglargemessages"/>

             

                            <connectors>

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

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

                            </connectors>

             

                            <acceptors>

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

                            </acceptors>

             

                            <broadcast-groups>

                                <broadcast-group name="bg-group-backup">

                                    <socket-binding>messaging-group</socket-binding>

                                    <broadcast-period>2000</broadcast-period>

                                    <connector-ref>

                                        netty-backup

                                    </connector-ref>

                                </broadcast-group>

                            </broadcast-groups>

             

                            <discovery-groups>

                                <discovery-group name="dg-group-backup">

                                    <socket-binding>messaging-group</socket-binding>

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

                                </discovery-group>

                            </discovery-groups>

             

                            <cluster-connections>

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

                                    <address>jms</address>

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

                                    <retry-interval>1000</retry-interval>

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

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

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

                                    <discovery-group-ref discovery-group-name="dg-group-backup"/>

                                </cluster-connection>

                            </cluster-connections>

             

                            <security-settings>

                                <security-setting match="#">

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

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

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

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

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

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

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

                                </security-setting>

                            </security-settings>

             

                            <address-settings>

                                <address-setting match="#">

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

                                    <max-delivery-attempts>200</max-delivery-attempts>

                                    <max-size-bytes>1048576</max-size-bytes>

                                    <page-size-bytes>524288</page-size-bytes>

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

                                    <redistribution-delay>0</redistribution-delay>

                                </address-setting>

                            </address-settings>

            </hornetq-server>

            </subsystem>

                ...

                <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">      

                    <socket-binding name="messaging" port="5445"/>

                    <socket-binding name="messaging-group" port="0" multicast-address="${jboss.messaging.group.address:231.7.7.7}" multicast-port="${jboss.messaging.group.port:9876}"/>

                    <socket-binding name="messaging-throughput" port="5455"/>

                    <socket-binding name="messaging-backup" port="5446"/>      

                    ...

                </socket-binding-group>

            </server>

             

            Cheers,

            Mirek

            • 3. Re: HornetQ live and backup on the same server.
              Jay Tommy Newbie

              Thanks for your reply guys !

               

              I have edited my configs now. But in the JBoss Web console, I am unable to see any JMS Queues. It says 0. But I find that the JMS config is correct here. Any idea what might be wrong ?

               

              JBoss1 ::

               

              <?xml version='1.0' encoding='UTF-8'?>

               

               

              <server xmlns="urn:jboss:domain:1.5">

               

               

                  <extensions>

                      <extension module="org.jboss.as.clustering.infinispan"/>

                      <extension module="org.jboss.as.configadmin"/>

                      <extension module="org.jboss.as.connector"/>

                      <extension module="org.jboss.as.jdr"/>

                      <extension module="org.jboss.as.jmx"/>

                      <extension module="org.jboss.as.logging"/>

                      <extension module="org.jboss.as.mail"/>

                      <extension module="org.jboss.as.messaging"/>

                      <extension module="org.jboss.as.naming"/>

                      <extension module="org.jboss.as.osgi"/>

                      <extension module="org.jboss.as.remoting"/>

                      <extension module="org.jboss.as.sar"/>

                      <extension module="org.jboss.as.security"/>

                      <extension module="org.jboss.as.threads"/>

                      <extension module="org.jboss.as.transactions"/>

                      <extension module="org.jboss.as.web"/>

                  </extensions>

               

               

                  <management>

                      <security-realms>

                          <security-realm name="ManagementRealm">

                              <authentication>

                                  <local default-user="$local"/>

                                  <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>

                              </authentication>

                          </security-realm>

                          <security-realm name="ApplicationRealm">

                              <authentication>

                                  <local default-user="$local" allowed-users="*"/>

                                  <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>

                              </authentication>

                              <authorization>

                                  <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>

                              </authorization>

                          </security-realm>

                      </security-realms>

                      <management-interfaces>

                          <native-interface security-realm="ManagementRealm">

                              <socket-binding native="management-native"/>

                          </native-interface>

                          <http-interface security-realm="ManagementRealm">

                              <socket-binding http="management-http"/>

                          </http-interface>

                      </management-interfaces>

                  </management>

               

               

                  <profile>

                      <subsystem xmlns="urn:jboss:domain:logging:1.3">

                          <console-handler name="CONSOLE">

                              <level name="DEBUG"/>

                              <formatter>

                                  <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%C] (%t) %s%E%n"/>

                              </formatter>

                          </console-handler>

                          <periodic-rotating-file-handler name="FILE">

                              <level name="DEBUG"/>

                              <formatter>

                                  <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS}| %-5p [%C] (%t)|%m%n"/>

                              </formatter>

                              <file relative-to="jboss.server.log.dir" path="server.log"/>

                              <suffix value=".yyyy-MM-dd-HH"/>

                              <append value="true"/>

                          </periodic-rotating-file-handler>

                          <logger category="com.arjuna">

                              <level name="WARN"/>

                          </logger>

                          <logger category="org.apache.tomcat.util.modeler">

                              <level name="WARN"/>

                          </logger>

                          <logger category="sun.rmi">

                              <level name="WARN"/>

                          </logger>

                          <logger category="jacorb">

                              <level name="WARN"/>

                          </logger>

                          <logger category="jacorb.config">

                              <level name="ERROR"/>

                          </logger>

              <!--    <logger category="org.hornetq">

                <level name="FINEST"/>

                   </logger>

              -->

                          <root-logger>

                              <level name="DEBUG"/>

                              <handlers>

                                  <handler name="FILE"/>

                              </handlers>

                          </root-logger>

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:configadmin:1.0"/>

               

               

                      <subsystem xmlns="urn:jboss:domain:infinispan:1.4">

                          <cache-container name="hibernate" default-cache="local-query" module="org.jboss.as.jpa.hibernate:4">

                              <local-cache name="entity">

                                  <transaction mode="NON_XA"/>

                                  <eviction strategy="LRU" max-entries="10000"/>

                                  <expiration max-idle="100000"/>

                              </local-cache>

                              <local-cache name="local-query">

                                  <transaction mode="NONE"/>

                                  <eviction strategy="LRU" max-entries="10000"/>

                                  <expiration max-idle="100000"/>

                              </local-cache>

                              <local-cache name="timestamps">

                                  <transaction mode="NONE"/>

                                  <eviction strategy="NONE"/>

                              </local-cache>

                          </cache-container>

                      </subsystem>

               

               

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

                          <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>

                          <bean-validation enabled="true"/>

                          <default-workmanager>

                              <short-running-threads>

                                  <core-threads count="50"/>

                                  <queue-length count="50"/>

                                  <max-threads count="50"/>

                                  <keepalive-time time="10" unit="seconds"/>

                              </short-running-threads>

                              <long-running-threads>

                                  <core-threads count="50"/>

                                  <queue-length count="50"/>

                                  <max-threads count="50"/>

                                  <keepalive-time time="10" unit="seconds"/>

                              </long-running-threads>

                          </default-workmanager>

                          <cached-connection-manager/>

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>

                      <subsystem xmlns="urn:jboss:domain:jmx:1.3">

                          <expose-resolved-model/>

                          <expose-expression-model/>

                          <remoting-connector/>

                      </subsystem>

               

               

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

                          <mail-session jndi-name="java:jboss/mail/Default">

                              <smtp-server outbound-socket-binding-ref="mail-smtp"/>

                          </mail-session>

                      </subsystem>

                     

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

                          <hornetq-server name="live">

                <cluster-password>Ike28LLtq</cluster-password>

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

                              <backup>false</backup>

                              <failover-on-shutdown>true</failover-on-shutdown>

                              <shared-store>true</shared-store>

                              <journal-type>NIO</journal-type>

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

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

               

                <allow-failback>true</allow-failback>

                <check-for-live-server>true</check-for-live-server>

                <backup-group-name>live1-backup1-group</backup-group-name>

               

               

                              <paging-directory path="../../../../../../share/pel/paging"/>

                              <bindings-directory path="../../../../../../share/pel/bindings"/>

                              <journal-directory path="../../../../../../share/pel/journal"/>

                              <large-messages-directory path="../../../../../../share/pel/largemessages"/>

               

               

                              <connectors>

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

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

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

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

                                  </netty-connector>

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

                              </connectors>

               

               

                              <acceptors>

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

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

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

                                      <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="bg-group1">

                <socket-binding>messaging-group</socket-binding>

                                      <broadcast-period>5000</broadcast-period>

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

                                  </broadcast-group>

                              </broadcast-groups>

               

               

                              <discovery-groups>

                                  <discovery-group name="dg-group1">

                <socket-binding>messaging-group</socket-binding>

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

                                  </discovery-group>

                              </discovery-groups>

               

               

                              <cluster-connections>

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

                                      <address>jms</address>

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

                                      <discovery-group-ref discovery-group-name="dg-group1"/>

                                  </cluster-connection>

                              </cluster-connections>

               

               

                              <security-settings>

                                  <security-setting match="#">

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

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

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

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

                                  </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>

                                      <redistribution-delay>1000</redistribution-delay>

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

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

                                      <page-size-bytes>2097152</page-size-bytes>

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

                                  </address-setting>

                              </address-settings>

               

               

                              <jms-connection-factories>

                                  <connection-factory name="InVmConnectionFactory">

                                      <connectors>

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

                                      </connectors>

                                      <entries>

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

                                      </entries>

                                  </connection-factory>

                                  <connection-factory name="RemoteConnectionFactory">

                                      <connectors>

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

                                      </connectors>

                                      <entries>

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

                                      </entries>

                                      <ha>true</ha>

                                      <block-on-acknowledge>true</block-on-acknowledge>

                                      <retry-interval>1000</retry-interval>

                                      <retry-interval-multiplier>1.0</retry-interval-multiplier>

                                      <reconnect-attempts>-1</reconnect-attempts>

                                  </connection-factory>

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

                                      <transaction mode="xa"/>

                                      <connectors>

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

                                      </connectors>

                                      <entries>

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

                                      </entries>

                                  </pooled-connection-factory>

                              </jms-connection-factories>

               

               

                              <jms-destinations>

                                  <jms-queue name="AuroralIAMEventsQueue">

                                      <entry name="queue/AuroralIAMEventsQueue"/>

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

                                  </jms-queue>

                              </jms-destinations>

                          </hornetq-server>

               

               

                          <hornetq-server name="backup2">

                              <cluster-password>Ike28LLtq</cluster-password>

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

                              <backup>true</backup>

                              <failover-on-shutdown>true</failover-on-shutdown>

                              <shared-store>true</shared-store>

                              <journal-type>NIO</journal-type>

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

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

               

                <allow-failback>true</allow-failback>

                <check-for-live-server>true</check-for-live-server>

                <backup-group-name>live2-backup2-group</backup-group-name>

               

               

                              <paging-directory path="../../../../../../share/pel2/paging"/>

                              <bindings-directory path="../../../../../../share/pel2/bindings"/>

                              <journal-directory path="../../../../../../share/pel2/journal"/>

                              <large-messages-directory path="../../../../../../share/pel2/largemessages"/>

               

               

                              <connectors>

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

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

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

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

                                  </netty-connector>

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

                              </connectors>

               

               

                              <acceptors>

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

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

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

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

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

                                  </netty-acceptor>

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

                              </acceptors>

               

               

                              <broadcast-groups>

                                  <broadcast-group name="bg-group1">

                                      <socket-binding>messaging-group</socket-binding>

                                      <broadcast-period>5000</broadcast-period>

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

                                  </broadcast-group>

                              </broadcast-groups>

               

               

                              <discovery-groups>

                                  <discovery-group name="dg-group1">

                                      <socket-binding>messaging-group</socket-binding>

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

                                  </discovery-group>

                              </discovery-groups>

               

               

                              <cluster-connections>

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

                                      <address>jms</address>

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

                                      <discovery-group-ref discovery-group-name="dg-group1"/>

                                  </cluster-connection>

                              </cluster-connections>

               

               

                          </hornetq-server>

               

               

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:naming:1.4">

                          <remote-naming/>

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="lazy">

                          <properties>

                              <property name="org.osgi.framework.startlevel.beginning">

                                  1

                              </property>

                          </properties>

                          <capabilities>

                              <capability name="javax.servlet.api:v25"/>

                              <capability name="javax.transaction.api"/>

                              <capability name="org.apache.felix.log" startlevel="1"/>

                              <capability name="org.jboss.osgi.logging" startlevel="1"/>

                              <capability name="org.apache.felix.configadmin" startlevel="1"/>

                              <capability name="org.jboss.as.osgi.configadmin" startlevel="1"/>

                          </capabilities>

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:remoting:1.1"/>

                      <subsystem xmlns="urn:jboss:domain:resource-adapters:1.1"/>

                      <subsystem xmlns="urn:jboss:domain:sar:1.0"/>

                      <subsystem xmlns="urn:jboss:domain:security:1.2">

                          <security-domains>

                              <security-domain name="other" cache-type="default">

                                  <authentication>

                                      <login-module code="Remoting" flag="optional">

                                          <module-option name="password-stacking" value="useFirstPass"/>

                                      </login-module>

                                      <login-module code="RealmUsersRoles" flag="required">

                                          <module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>

                                          <module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>

                                          <module-option name="realm" value="ApplicationRealm"/>

                                          <module-option name="password-stacking" value="useFirstPass"/>

                                      </login-module>

                                  </authentication>

                              </security-domain>

                              <security-domain name="jboss-web-policy" cache-type="default">

                                  <authorization>

                                      <policy-module code="Delegating" flag="required"/>

                                  </authorization>

                              </security-domain>

                              <security-domain name="jboss-ejb-policy" cache-type="default">

                                  <authorization>

                                      <policy-module code="Delegating" flag="required"/>

                                  </authorization>

                              </security-domain>

                              <security-domain name="InternalAPI" cache-type="default">

                                  <authentication>

                                      <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">

                                          <module-option name="usersProperties" value="/InternalAPI-users.properties"/>

                                          <module-option name="rolesProperties" value="/InternalAPI-user-roles.properties"/>

                                      </login-module>

                                  </authentication>

                              </security-domain>

                          </security-domains>

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:threads:1.1"/>

                      <subsystem xmlns="urn:jboss:domain:transactions:1.4">

                   <core-environment>

                              <process-id>

                                  <uuid/>

                              </process-id>

                          </core-environment>

                          <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>

                          <coordinator-environment default-timeout="300"/>

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:web:1.5"/>

                  </profile>

               

               

                  <interfaces>

                      <interface name="management">

                          <inet-address value="${jboss.bind.address.management:0.0.0.0}"/>

                      </interface>

                      <interface name="public">

                          <inet-address value="jmspublichost"/>

                      </interface>

                      <interface name="chassis">

                          <inet-address value="jmslocalhost"/>

                      </interface>

                      <interface name="unsecure">

                          <inet-address value="${jboss.bind.address.unsecure:0.0.0.0}"/>

                      </interface>

                  </interfaces>

               

               

                  <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

                      <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>

                      <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>

                      <socket-binding name="ajp" port="8009"/>

                      <socket-binding name="http" port="8080"/>

                      <socket-binding name="https" port="9433"/>

                      <socket-binding name="osgi-http" interface="management" port="8090"/>

                      <socket-binding name="txn-recovery-environment" port="4712"/>

                      <socket-binding name="txn-status-manager" port="4713"/>

              <socket-binding name="messaging-live1-backup1" port="5445"/>

              <socket-binding name="messaging-live2-backup2" port="5446"/>

                      <socket-binding name="messaging-group" interface="chassis" port="0" multicast-address="${jboss.messaging.group.address:230.0.0.1}" multicast-port="${jboss.messaging.group.port:9876}"/>

                      <socket-binding name="messaging-throughput" port="5455"/>

                      <outbound-socket-binding name="mail-smtp">

                          <remote-destination host="localhost" port="25"/>

                      </outbound-socket-binding>

                  </socket-binding-group>

              </server>

               

              JBoss2 ::

               

              <?xml version='1.0' encoding='UTF-8'?>

               

               

              <server xmlns="urn:jboss:domain:1.5">

               

               

                  <extensions>

                      <extension module="org.jboss.as.clustering.infinispan"/>

                      <extension module="org.jboss.as.configadmin"/>

                      <extension module="org.jboss.as.connector"/>

                      <extension module="org.jboss.as.jdr"/>

                      <extension module="org.jboss.as.jmx"/>

                      <extension module="org.jboss.as.logging"/>

                      <extension module="org.jboss.as.mail"/>

                      <extension module="org.jboss.as.messaging"/>

                      <extension module="org.jboss.as.naming"/>

                      <extension module="org.jboss.as.osgi"/>

                      <extension module="org.jboss.as.remoting"/>

                      <extension module="org.jboss.as.sar"/>

                      <extension module="org.jboss.as.security"/>

                      <extension module="org.jboss.as.threads"/>

                      <extension module="org.jboss.as.transactions"/>

                      <extension module="org.jboss.as.web"/>

                  </extensions>

               

               

                  <management>

                      <security-realms>

                          <security-realm name="ManagementRealm">

                              <authentication>

                                  <local default-user="$local"/>

                                  <properties path="mgmt-users.properties" relative-to="jboss.server.config.dir"/>

                              </authentication>

                          </security-realm>

                          <security-realm name="ApplicationRealm">

                              <authentication>

                                  <local default-user="$local" allowed-users="*"/>

                                  <properties path="application-users.properties" relative-to="jboss.server.config.dir"/>

                              </authentication>

                              <authorization>

                                  <properties path="application-roles.properties" relative-to="jboss.server.config.dir"/>

                              </authorization>

                          </security-realm>

                      </security-realms>

                      <management-interfaces>

                          <native-interface security-realm="ManagementRealm">

                              <socket-binding native="management-native"/>

                          </native-interface>

                          <http-interface security-realm="ManagementRealm">

                              <socket-binding http="management-http"/>

                          </http-interface>

                      </management-interfaces>

                  </management>

               

               

                  <profile>

                      <subsystem xmlns="urn:jboss:domain:logging:1.3">

                          <console-handler name="CONSOLE">

                              <level name="DEBUG"/>

                              <formatter>

                                  <pattern-formatter pattern="%d{HH:mm:ss,SSS} %-5p [%C] (%t) %s%E%n"/>

                              </formatter>

                          </console-handler>

                          <periodic-rotating-file-handler name="FILE">

                              <level name="DEBUG"/>

                              <formatter>

                                  <pattern-formatter pattern="%d{yyyy-MM-dd HH:mm:ss,SSS}| %-5p [%C] (%t)|%m%n"/>

                              </formatter>

                              <file relative-to="jboss.server.log.dir" path="server.log"/>

                              <suffix value=".yyyy-MM-dd-HH"/>

                              <append value="true"/>

                          </periodic-rotating-file-handler>

                          <logger category="com.arjuna">

                              <level name="WARN"/>

                          </logger>

                          <logger category="org.apache.tomcat.util.modeler">

                              <level name="WARN"/>

                          </logger>

                          <logger category="sun.rmi">

                              <level name="WARN"/>

                          </logger>

                          <logger category="jacorb">

                              <level name="WARN"/>

                          </logger>

                          <logger category="jacorb.config">

                              <level name="ERROR"/>

                          </logger>

              <!--    <logger category="org.hornetq">

                        <level name="FINEST"/>

                   </logger>

              -->

                          <root-logger>

                              <level name="DEBUG"/>

                              <handlers>

                                  <handler name="FILE"/>

                              </handlers>

                          </root-logger>

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:configadmin:1.0"/>

               

               

                      <subsystem xmlns="urn:jboss:domain:infinispan:1.4">

                          <cache-container name="hibernate" default-cache="local-query" module="org.jboss.as.jpa.hibernate:4">

                              <local-cache name="entity">

                                  <transaction mode="NON_XA"/>

                                  <eviction strategy="LRU" max-entries="10000"/>

                                  <expiration max-idle="100000"/>

                              </local-cache>

                              <local-cache name="local-query">

                                  <transaction mode="NONE"/>

                                  <eviction strategy="LRU" max-entries="10000"/>

                                  <expiration max-idle="100000"/>

                              </local-cache>

                              <local-cache name="timestamps">

                                  <transaction mode="NONE"/>

                                  <eviction strategy="NONE"/>

                              </local-cache>

                          </cache-container>

                      </subsystem>

               

               

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

                          <archive-validation enabled="true" fail-on-error="true" fail-on-warn="false"/>

                          <bean-validation enabled="true"/>

                          <default-workmanager>

                              <short-running-threads>

                                  <core-threads count="50"/>

                                  <queue-length count="50"/>

                                  <max-threads count="50"/>

                                  <keepalive-time time="10" unit="seconds"/>

                              </short-running-threads>

                              <long-running-threads>

                                  <core-threads count="50"/>

                                  <queue-length count="50"/>

                                  <max-threads count="50"/>

                                  <keepalive-time time="10" unit="seconds"/>

                              </long-running-threads>

                          </default-workmanager>

                          <cached-connection-manager/>

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:jdr:1.0"/>

                      <subsystem xmlns="urn:jboss:domain:jmx:1.3">

                          <expose-resolved-model/>

                          <expose-expression-model/>

                          <remoting-connector/>

                      </subsystem>

               

               

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

                          <mail-session jndi-name="java:jboss/mail/Default">

                              <smtp-server outbound-socket-binding-ref="mail-smtp"/>

                          </mail-session>

                      </subsystem>

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

                          <hornetq-server name="backup">

                <cluster-password>Ike28LLtq</cluster-password>

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

                              <backup>true</backup>

                              <failover-on-shutdown>true</failover-on-shutdown>

                              <shared-store>true</shared-store>

               

               

                              <journal-type>NIO</journal-type>

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

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

               

                <allow-failback>true</allow-failback>

                <check-for-live-server>true</check-for-live-server>

                <backup-group-name>live1-backup1-group</backup-group-name>

               

               

                              <paging-directory path="../../../../../../share/pel/paging"/>

                              <bindings-directory path="../../../../../../share/pel/bindings"/>

                              <journal-directory path="../../../../../../share/pel/journal"/>

                              <large-messages-directory path="../../../../../../share/pel/largemessages"/>

               

               

                              <connectors>

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

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

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

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

                                  </netty-connector>

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

                              </connectors>

               

               

                              <acceptors>

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

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

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

                                      <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="bg-group1">

                <socket-binding>messaging-group</socket-binding>

                                      <broadcast-period>5000</broadcast-period>

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

                                  </broadcast-group>

                              </broadcast-groups>

               

               

                              <discovery-groups>

                                  <discovery-group name="dg-group1">

                <socket-binding>messaging-group</socket-binding>

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

                                  </discovery-group>

                              </discovery-groups>

               

               

                              <cluster-connections>

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

                                      <address>jms</address>

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

                                      <discovery-group-ref discovery-group-name="dg-group1"/>

                                  </cluster-connection>

                              </cluster-connections>

                          </hornetq-server>

                        

                          <hornetq-server name="live2">

                <cluster-password>Ike28LLtq</cluster-password>

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

                              <backup>false</backup>

                              <failover-on-shutdown>true</failover-on-shutdown>

                              <shared-store>true</shared-store>

               

               

                              <journal-type>NIO</journal-type>

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

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

               

               

                <allow-failback>true</allow-failback>

                <check-for-live-server>true</check-for-live-server>

                <backup-group-name>live2-backup2-group</backup-group-name>

               

                              <paging-directory path="../../../../../../share/pel2/paging"/>

                              <bindings-directory path="../../../../../../share/pel2/bindings"/>

                              <journal-directory path="../../../../../../share/pel2/journal"/>

                              <large-messages-directory path="../../../../../../share/pel2/largemessages"/>

               

               

                              <connectors>

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

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

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

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

                                  </netty-connector>

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

                              </connectors>

               

               

                              <acceptors>

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

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

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

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

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

                                  </netty-acceptor>

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

                              </acceptors>

               

               

                              <broadcast-groups>

                                  <broadcast-group name="bg-group1">

                <socket-binding>messaging-group</socket-binding>

                                      <broadcast-period>5000</broadcast-period>

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

                                  </broadcast-group>

                              </broadcast-groups>

               

               

                              <discovery-groups>

                                  <discovery-group name="dg-group1">

                <socket-binding>messaging-group</socket-binding>

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

                                  </discovery-group>

                              </discovery-groups>

               

               

                              <cluster-connections>

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

                                      <address>jms</address>

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

                                      <discovery-group-ref discovery-group-name="dg-group1"/>

                                  </cluster-connection>

                              </cluster-connections>

               

               

                              <security-settings>

                                  <security-setting match="#">

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

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

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

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

                                  </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>

                                      <redistribution-delay>1000</redistribution-delay>

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

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

                                      <page-size-bytes>2097152</page-size-bytes>

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

                                  </address-setting>

                              </address-settings>

               

               

                              <jms-connection-factories>

                                  <connection-factory name="InVmConnectionFactory">

                                      <connectors>

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

                                      </connectors>

                                      <entries>

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

                                      </entries>

                                  </connection-factory>

                                  <connection-factory name="RemoteConnectionFactory">

                                      <connectors>

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

                                      </connectors>

                                      <entries>

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

                                      </entries>

                                      <ha>true</ha>

                                      <block-on-acknowledge>true</block-on-acknowledge>

                                      <retry-interval>1000</retry-interval>

                                      <retry-interval-multiplier>1.0</retry-interval-multiplier>

                                      <reconnect-attempts>-1</reconnect-attempts>

                                  </connection-factory>

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

                                      <transaction mode="xa"/>

                                      <connectors>

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

                                      </connectors>

                                      <entries>

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

                                      </entries>

                                  </pooled-connection-factory>

                              </jms-connection-factories>

               

               

                              <jms-destinations>

                                  <jms-queue name="AuroralIAMEventsQueue">

                                      <entry name="queue/AuroralIAMEventsQueue"/>

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

                                  </jms-queue>

                              </jms-destinations>

                          </hornetq-server>

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:naming:1.4">

                          <remote-naming/>

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:osgi:1.2" activation="lazy">

                          <properties>

                              <property name="org.osgi.framework.startlevel.beginning">

                                  1

                              </property>

                          </properties>

                          <capabilities>

                              <capability name="javax.servlet.api:v25"/>

                              <capability name="javax.transaction.api"/>

                              <capability name="org.apache.felix.log" startlevel="1"/>

                              <capability name="org.jboss.osgi.logging" startlevel="1"/>

                              <capability name="org.apache.felix.configadmin" startlevel="1"/>

                              <capability name="org.jboss.as.osgi.configadmin" startlevel="1"/>

                          </capabilities>

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:remoting:1.1"/>

                      <subsystem xmlns="urn:jboss:domain:resource-adapters:1.1"/>

                      <subsystem xmlns="urn:jboss:domain:sar:1.0"/>

                      <subsystem xmlns="urn:jboss:domain:security:1.2">

                          <security-domains>

                              <security-domain name="other" cache-type="default">

                                  <authentication>

                                      <login-module code="Remoting" flag="optional">

                                          <module-option name="password-stacking" value="useFirstPass"/>

                                      </login-module>

                                      <login-module code="RealmUsersRoles" flag="required">

                                          <module-option name="usersProperties" value="${jboss.server.config.dir}/application-users.properties"/>

                                          <module-option name="rolesProperties" value="${jboss.server.config.dir}/application-roles.properties"/>

                                          <module-option name="realm" value="ApplicationRealm"/>

                                          <module-option name="password-stacking" value="useFirstPass"/>

                                      </login-module>

                                  </authentication>

                              </security-domain>

                              <security-domain name="jboss-web-policy" cache-type="default">

                                  <authorization>

                                      <policy-module code="Delegating" flag="required"/>

                                  </authorization>

                              </security-domain>

                              <security-domain name="jboss-ejb-policy" cache-type="default">

                                  <authorization>

                                      <policy-module code="Delegating" flag="required"/>

                                  </authorization>

                              </security-domain>

                              <security-domain name="InternalAPI" cache-type="default">

                                  <authentication>

                                      <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag="required">

                                          <module-option name="usersProperties" value="/InternalAPI-users.properties"/>

                                          <module-option name="rolesProperties" value="/InternalAPI-user-roles.properties"/>

                                      </login-module>

                                  </authentication>

                              </security-domain>

                          </security-domains>

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:threads:1.1"/>

                      <subsystem xmlns="urn:jboss:domain:transactions:1.4">

                   <core-environment>

                              <process-id>

                                  <uuid/>

                              </process-id>

                          </core-environment>

                          <recovery-environment socket-binding="txn-recovery-environment" status-socket-binding="txn-status-manager"/>

                          <coordinator-environment default-timeout="300"/>

                      </subsystem>

                      <subsystem xmlns="urn:jboss:domain:web:1.5"/>

                  </profile>

               

               

                  <interfaces>

                      <interface name="management">

                          <inet-address value="${jboss.bind.address.management:0.0.0.0}"/>

                      </interface>

                      <interface name="public">

                          <inet-address value="jmspublichost"/>

                      </interface>

                      <interface name="chassis">

                          <inet-address value="jmslocalhost"/>

                      </interface>

                      <interface name="unsecure">

                          <inet-address value="${jboss.bind.address.unsecure:0.0.0.0}"/>

                      </interface>

                  </interfaces>

               

               

                  <socket-binding-group name="standard-sockets" default-interface="public" port-offset="${jboss.socket.binding.port-offset:0}">

                      <socket-binding name="management-native" interface="management" port="${jboss.management.native.port:9999}"/>

                      <socket-binding name="management-http" interface="management" port="${jboss.management.http.port:9990}"/>

                      <socket-binding name="ajp" port="8009"/>

                      <socket-binding name="http" port="8080"/>

                      <socket-binding name="https" port="9433"/>

                      <socket-binding name="osgi-http" interface="management" port="8090"/>

                      <socket-binding name="txn-recovery-environment" port="4712"/>

                      <socket-binding name="txn-status-manager" port="4713"/>

              <socket-binding name="messaging-live1-backup1" port="5445"/>

              <socket-binding name="messaging-live2-backup2" port="5446"/>

                      <socket-binding name="messaging-group" interface="chassis" port="0" multicast-address="${jboss.messaging.group.address:230.0.0.1}" multicast-port="${jboss.messaging.group.port:9876}"/>

                      <socket-binding name="messaging-throughput" port="5455"/>

                      <outbound-socket-binding name="mail-smtp">

                          <remote-destination host="localhost" port="25"/>

                      </outbound-socket-binding>

                  </socket-binding-group>

              </server>

              • 4. Re: HornetQ live and backup on the same server.
                Miroslav Novak Master

                Hi Jay,

                 

                I tried you config and I can see JMS destination AuroralIAMEventsQueue in Web Console. It's located in Runtime -> JMS Destinations -> click "live" in JMS Messaging Provider and you will see that queue is there.

                 

                I have a note to the config - you can remove following attributes from your configuration as they're relavant only for HA with replicated journal:

                <check-for-live-server>true</check-for-live-server>

                <backup-group-name>live2-backup2-group</backup-group-name>

                 

                also you should use socket-binding in connector/acceptor "throughput" config. Using param for host/port is deprecated and it does not reflect port-offset for EAP server.

                 

                Otherwise your current config should work well.

                 

                Thanks,

                Mirek

                 

                Edit:

                One important note - as you're using GFS2, you should use <journal-type>ASYNCIO</journal-type> as it's supported config. You will need to unzip zip with natives above your JBOSS_HOME directories so libAIO...so files are unzipped to org.hornetq modules.

                • 5. Re: HornetQ live and backup on the same server.
                  Jay Tommy Newbie

                  Thank You Miroslav for your help in this matter. Much appreciated.

                   

                  I do see "JMS destination AuroralIAMEventsQueue in Web Console. It's located in Runtime -> JMS Destinations -> click "live" in JMS Messaging Provider and you will see that queue is there" . But once I test the setup, although my Java client says "Notification successfully sent", the JMS counter is always 0. (See image below).

                   

                  This is the only thing that worries me now. I'm new to hornetq and I've read a lot of documentation on this but cant figure out as to why my Queue Metrics are all still 0.

                   

                  Capture.JPG

                  • 6. Re: HornetQ live and backup on the same server.
                    Miroslav Novak Master

                    I guess there might be bug in this monitoring. Which version of EAP 6 are you using?

                    • 7. Re: HornetQ live and backup on the same server.
                      Jay Tommy Newbie

                      EAP 6.4.0

                       


                      2016-07-17 07:51:36,840| DEBUG [org.jboss.as.server.ApplicationServerService] (MSC service thread 1-7)|JBoss EAP 6.4.0.GA (AS 7.5.0.Final-redhat-21)

                      root service started in 2911839604.753141 ms

                      • 8. Re: HornetQ live and backup on the same server.
                        Miroslav Novak Master

                        I tried it with EAP 6.4.0.GA and can see all the statistics. However I had to click on the row with queue. queue-statistics.png

                        • 9. Re: HornetQ live and backup on the same server.
                          Jay Tommy Newbie

                          Thank you for your reply Miroslav.

                           

                          Did you try with my config ? The issue is that my setup is being accessed using the Multicast IP. 230.0.0.1 over port 9876 as configured.

                           

                          <socket-binding name="messaging-group" interface="chassis" port="0" multicast-address="${jboss.messaging.group.address:230.0.0.1}" multicast-port="${jboss.messaging.group.port:9876}"/>

                           

                          Although the remote application gets the message "Notification sent successfully" , I am unable to see any Queue metrics. All 0.

                          • 10. Re: HornetQ live and backup on the same server.
                            Miroslav Novak Master

                            Could you check both of the servers (live servers) just to be sure that it was not send to 2nd server? Is it possible to consume the send messages?

                            • 11. Re: HornetQ live and backup on the same server.
                              Jay Tommy Newbie

                              Yes I did check it. On both JBoss consoles, the counter is 0. I added the following too:

                               

                                              <message-counter-enabled>true</message-counter-enabled>

                                              <message-counter-sample-period>10000</message-counter-sample-period>

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

                               

                              Still no resolution  

                              • 12. Re: HornetQ live and backup on the same server.
                                Jay Tommy Newbie

                                Was able to solve the issue.

                                 

                                I just changed the names of the live servers to default.

                                 

                                Now the counters are being updated on both nodes.

                                • 13. Re: HornetQ live and backup on the same server.
                                  Miroslav Novak Master

                                  Great work! You found a bug in Web Console.   Could you create bugzilla for this issue? You can use Bug 1310537 – Lost large messages if backup is shutdown during synchronization as an example. Just set component "Web Console". There is low chance that it will be fixed but at least it will reported and that counts.