Proper Reconnection Configuration
mikkeljb Jul 6, 2012 9:35 AMHi
We are using the HornetQ server in JBoss Application Server 7.1.1
We have a problem when consumers need to automatically reconnect to a server after a reboot.
Could somone please point out the error in the configuration?
Thanks
Mikkel
We are using two Jboss servers (A, B)
A and B are running the same standalone.xml configuration.
A have the loopback ip and are therefore the hornetQ server.
A and B are running the same ear file containing MDB's consuming from the hornetQ server.
Both the machines are rebooted.
B starts up before A
B will try to connect to A periodically until A is started, then it seems to get connected.
But only the MDBs on A will be registred as consumers
The following is from the standalone.xml used on both machines:
<subsystem xmlns="urn:jboss:domain:messaging:1.1">
<hornetq-server>
<persistence-enabled>true</persistence-enabled>
<jmx-management-enabled>true</jmx-management-enabled>
<message-counter-enabled>true</message-counter-enabled>
<message-counter-sample-period>60000</message-counter-sample-period>
<message-counter-max-day-history>7</message-counter-max-day-history>
<transaction-timeout>300000</transaction-timeout>
<id-cache-size>100000</id-cache-size>
<journal-file-size>102400</journal-file-size>
<journal-min-files>2</journal-min-files>
<connectors>
<netty-connector name="netty" socket-binding="messaging"/>
<netty-connector name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
</netty-connector>
<in-vm-connector name="in-vm" server-id="0"/>
</connectors>
<acceptors>
<netty-acceptor name="netty" socket-binding="messaging"/>
<netty-acceptor name="netty-throughput" socket-binding="messaging-throughput">
<param key="batch-delay" value="50"/>
<param key="direct-deliver" value="false"/>
</netty-acceptor>
<in-vm-acceptor name="in-vm" server-id="0"/>
</acceptors>
<security-settings>
<security-setting match="#">
<permission type="send" roles="guest"/>
<permission type="consume" roles="guest"/>
<permission type="createNonDurableQueue" roles="guest"/>
<permission type="deleteNonDurableQueue" roles="guest"/>
</security-setting>
</security-settings>
<address-settings>
<address-setting match="#">
<dead-letter-address>jms.queue.DLQ</dead-letter-address>
<expiry-address>jms.queue.ExpiryQueue</expiry-address>
<redelivery-delay>3000</redelivery-delay>
<max-delivery-attempts>3</max-delivery-attempts>
<message-counter-history-day-limit>10</message-counter-history-day-limit>
</address-setting>
<address-setting match="jms.queue.workerQueue">
<max-size-bytes>1073741824</max-size-bytes>
<address-full-policy>DROP</address-full-policy>
</address-setting>
<address-setting match="jms.queue.DLQ">
<max-size-bytes>1073741824</max-size-bytes>
<page-size-bytes>104857600</page-size-bytes>
<address-full-policy>PAGE</address-full-policy>
</address-setting>
<address-setting match="jms.queue.ExpiryQueue">
<max-size-bytes>1073741824</max-size-bytes>
<page-size-bytes>104857600</page-size-bytes>
<address-full-policy>PAGE</address-full-policy>
</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>
<consumer-window-size>0</consumer-window-size>
</connection-factory>
<connection-factory name="RemoteConnectionFactory">
<connectors>
<connector-ref connector-name="netty"/>
</connectors>
<entries>
<entry name="RemoteConnectionFactory"/>
<entry name="java:jboss/exported/jms/RemoteConnectionFactory"/>
</entries>
</connection-factory>
<pooled-connection-factory name="hornetq-ra">
<transaction mode="xa"/>
<connectors>
<connector-ref connector-name="netty"/>
</connectors>
<entries>
<entry name="java:/JmsXA"/>
</entries>
<retry-interval>1000</retry-interval>
<retry-interval-multiplier>1.5</retry-interval-multiplier>
<max-retry-interval>30000</max-retry-interval>
<reconnect-attempts>1000</reconnect-attempts>
</pooled-connection-factory>
</jms-connection-factories>
<jms-destinations>
<jms-queue name="workerQueue">
<entry name="queue/workerQueue"/>
<entry name="java:jboss/exported/jms/queue/workerQueue"/>
</jms-queue>
</jms-queue>
<jms-queue name="DLQ">
<entry name="queue/DLQ"/>
<entry name="java:jboss/exported/jms/queue/DLQ"/>
</jms-queue>
<jms-queue name="ExpiryQueue">
<entry name="queue/ExpiryQueue"/>
<entry name="java:jboss/exported/jms/queue/ExpiryQueue"/>
</jms-queue>
</jms-destinations>
</hornetq-server>
</subsystem>
<interfaces>
[…]
<interface name="remotehornetq">
<loopback-address value="192.168.1.9"/>
</interface>
</interfaces>