you need to cluster your hornetq instances, take a look at one of the many clustered examples shipped with HornetQ.
you can use the jmx console tomake sure that there are cluster connections between the nodes and where any messages may be
i'm not using hornetQ inside JBoss. I have an additional server running a standalone hornetQ server in non-clustered mode.
could you explain a bit clearer what is where you mentioned sending a message from jboss, are you just running a client here. Im not to sure what your topology actually is.
Ok, i try.
i have a Java desktop application that is working with an ejb-application running on a 2-node JBoss5 cluster.
If a user presses a specific button in the desktop app, the ejb-application gets a command to send a jms message to a standalone, non-clustered hornetQ server. The message should be consumed by the Apache Camel instance running also on the server where the hornetQ is running.
When i point my desktop app to work only with the first node of the JBoss-cluster (using 10.1.2.1:1099) and push the button to send the jms message, all is fine. The message is put in the hornetQ and Camel consumes it.
But when i point my desktop app to the second node (using 10.1.2.2:1099), the message is put into the hornetq, but it is not delivered to the consumer (Camel). And as i put a timeToLive of 3 seconds on the message, the message is, because it is not delivered, put in an expiryQueue.
Its some kind of weird because the config of the jboss nodes are the same, i checked it with diff tools.
And again to be sure: there is no cluster except the jboss. And i don't use the hornetq inside the jbosses but as an external standalone server.
it sounds to me as if its an issue with the camel consumer, not knowing much about it i couldnt comment. however a few things to mention. You dont have a clustered HornetQ as there is only one node so thats not an issue. Your jboss nodes are just HornetQ clients and we know the message gets to HornetQ as you say is sent to the Expiry Queue.
Try this, remove the time to live on the message and then after it is sent use the jmx console to look at thw stats on the queue, particularly consumer count, messages added, message count and delivery count