Cluster with explicitly specified nodes
akre Apr 27, 2011 6:30 AMHello
Please advice on the cluster configuration with explicitly specified nodes.
I'm doing all according documentation. There are two node with runned hornetQ servers 192.168.0.214 and 192.168.0.219. The JMS message appears on first node but it is not sent to the second one.
I have next in my hornetq-configuration.xml
{code:xml}
...
<connectors>
<connector name="in-vm">
<factory-class>org.hornetq.core.remoting.impl.invm.InVMConnectorFactory</factory-class>
</connector>
<connector name="cluster-1">
<factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
<param key="host" value="192.168.0.214" />
<param key="port" value="5446" />
</connector>
<connector name="cluster-2">
<factory-class>org.hornetq.integration.transports.netty.NettyConnectorFactory</factory-class>
<param key="host" value="192.168.0.219" />
<param key="port" value="5446" />
</connector>
</connectors>
<acceptors>
<acceptor name="in-vm">
<factory-class>org.hornetq.core.remoting.impl.invm.InVMAcceptorFactory</factory-class>
</acceptor>
<acceptor name="netty">
<factory-class>org.hornetq.integration.transports.netty.NettyAcceptorFactory</factory-class>
<param key="host" value="0.0.0.0" />
<param key="port" value="5446" />
</acceptor>
</acceptors>
<cluster-connections>
<cluster-connection name="cluster-1">
<address>#</address>
<retry-interval>500</retry-interval>
<use-duplicate-detection>true</use-duplicate-detection>
<forward-when-no-consumers>true</forward-when-no-consumers>
<max-hops>1</max-hops>
<connector-ref connector-name="cluster-1" />
</cluster-connection>
<cluster-connection name="cluster-2">
<address>#</address>
<retry-interval>500</retry-interval>
<use-duplicate-detection>true</use-duplicate-detection>
<forward-when-no-consumers>true</forward-when-no-consumers>
<max-hops>1</max-hops>
<connector-ref connector-name="cluster-2" />
</cluster-connection>
</cluster-connections>
...
{code}
and in hornetq-jms.xml
{code:xml}
<connection-factory name="InVMConnectionFactory">
<connectors>
<connector-ref connector-name="in-vm" />
</connectors>
<entries>
<entry name="/HQConnectionFactory" />
</entries>
</connection-factory>
{code}
Where is my mistake? Is the mentioned config enough? It starts be working if I add all connectors into connection-factory settings but as I understood it should work without it.
There is complete source code in attach
-
StaticClusterTest.zip 12.5 KB