HornetQ Stand-alone Clustered timeout
sami_gh Apr 11, 2011 6:20 PMHi All,
I am trying to configure HornetQ stand-alone clustered mode but without any luck. I have two instances of HornetQ running at my localhost along with the client. The problem is that I get the following error when I try to connect:
HornetQException[errorCode=3 message=Timed out waiting to receive initial broadcast from discovery group
Please find below my files:
hornetq-configuration.xml
<configuration xmlns="urn:hornetq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hornetq /schema/hornetq-configuration.xsd"> <clustered>true</clustered> <!-- Connectors --> <connectors> <connector name="netty-connector"> <factory-class>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</factory-class> <param key="port" value="5447"/> </connector> </connectors> <!-- Acceptors --> <acceptors> <acceptor name="netty-acceptor"> <factory-class>org.hornetq.core.remoting.impl.netty.NettyAcceptorFactory</factory-class> <param key="port" value="5447"/> </acceptor> </acceptors> <!-- Clustering configuration --> <broadcast-groups> <broadcast-group name="My-Broadcast"> <group-address>231.7.7.7</group-address> <group-port>9876</group-port> <broadcast-period>100</broadcast-period> <connector-ref connector-name="netty-connector"/> </broadcast-group> </broadcast-groups> <discovery-groups> <discovery-group name="My-Discovery"> <group-address>231.7.7.7</group-address> <group-port>9876</group-port> <refresh-timeout>10000</refresh-timeout> </discovery-group> </discovery-groups> <!-- Other config --> <security-settings> <!--security for example queue--> <security-setting match="jms.queue.exampleQueue"> <permission type="createDurableQueue" roles="guest"/> <permission type="deleteDurableQueue" roles="guest"/> <permission type="createNonDurableQueue" roles="guest"/> <permission type="deleteNonDurableQueue" roles="guest"/> <permission type="consume" roles="guest"/> <permission type="send" roles="guest"/> </security-setting> </security-settings> </configuration>
hornetq-jms.xml
<configuration xmlns="urn:hornetq" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:hornetq /schema/hornetq-jms.xsd"> <!--the connection factory used by the example--> <connection-factory name="ConnectionFactory"> <discovery-group-ref discovery-group-name="My-Discovery"/> <entries> <entry name="ConnectionFactory"/> </entries> </connection-factory> <topic name="TEST_TOPIC"> <entry name="/topic/TEST_TOPIC"/> </topic> </configuration>
Code:
final String groupAddress = "231.7.7.7"; final int groupPort = 9876; HornetQConnectionFactory cf = new HornetQConnectionFactory(groupAddress, groupPort); cf.setDiscoveryInitialWaitTimeout(10000); Connection connection = cf.createConnection(); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); connection.start();
I am using windows XP and HornetQ 2.1.2.Final. I didn't have any troubles connecting to non-clustered HornetQ.
I saw two other discussions with the same error, but their problems were related with remote clusters, so it didn't give me much help to discover the problem.
Any help is highly appreciated,
Thanks in Advance
Sami