You are confusing the semantics of HornetQ core API
Have a look at http://www.slideshare.net/gavinhogan/hornet-q-andthewebjudcon2010-7381151 (esp. starting from slide 53).
basically, using HornetQ core API, you send to an *address* and receives from *queues*
it's the way you bind queues to address that defines the messaging model
coreSession.createQueue(topicName, topicName, true);
=> You have created a queue with the name topicName (2nd param) bound to the *address* topicName (1st param)
=> You create a temp queue named clientID bound to the *address* topicName
messageConsumer = session.createConsumer(topicName,"CCAgent = '"+filter+"'");
=> You have create a consumer which will receive message from the *queue* named topicName. That's not what you want.
From your code, the 2 consumers receives messages from the queue named *topicName*, not from the temp queues you have created.
Have a look at the HornetQ javadoc API to avoid confusing address, queues: http://docs.jboss.org/hornetq/2.3.0.Alpha/docs/api/org/hornetq/api/core/client/ClientSession.html
To fix this:
1. There is no need to create a queue for the producer, it will send messages to an *address* fsevents
2. Create temp queues named "client1" & "client2" bound to the "fsevents" address
3. create consumers for the temp queues "client1" & "client2" and you're all set.
Thanks Jeff, the slides made it very clear.
Changes my code and it's working now.