I am trying to setup failover for our standalone applications(MessageSender and MessageReceiver) using JBoss Messaging.
I have created 3 nodes in my local machine to form a cluster like:
Message-Node0, Message-Node1,Message-Node2 and started the three nodes.
This is the ConnectionFactory properties I used for the Sender and Receiver applications:
I tested the following scenario:
1. Started the Receiver application (It is a 24x7 application)
2. Started the Sender application which sends text messages to the testDistributedQueue.
3. While publishing some messages I stopped the Messaging-node0 server.
4. The Sender and Receiver applications tries to get Connections using Recovery Algorithms.
I expected the messages will be published by getting connection(auto-discovery) using the other available nodes in the cluster(ie, node1 and node2)
But this is not happening.
This is because the application fails to discover the other nodes in the cluster.( We tried the same failover scenario for JbossMQ, that works fine.)
The application throws the following exception:
javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Failed to connect to server 10.212.65.25:1100 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server 10.212.65.25:1100 [Root exception is java.net.ConnectException: Connection timed out: connect]] [Root exception is javax.naming.CommunicationException: Failed to connect to server localhost:1099 [Root exception is javax.naming.ServiceUnavailableException: Failed to connect to server localhost:1099 [Root exception is java.net.ConnectException: Connection refused: connect]]]
If I use the port 1100 instead of 1099 the applications hanging (ie, the application does not throws any exception and also not publishing and receiving messages)
What could be the problem?
Do I need to setup anything to enable HAJNDI for each instance? Pls help.
Jboss Messaging 1.2.0 sp1
Thanks in Advance!