I have a farily simple application with a Spring JMS listener using HornetQ 2.1.1 standalone. The listener has only one thread to listen to messages and uses default configuration. The purpose of this listener is to fire a task execution when a message is received.
What I want to showcase is that if I start an additional copy of my application (simple war running on tomcat), it takes immediately the next tak in the queue and processes it. If I start another tomcat somewhere, it also participates immediately in the execution of those tasks, etc.
Unfortunately, it does not work that way. It seems that HornetQ (either server-side or client-side) "reserves" pending messages to a particular client and does not deliver them to new ones. I also have the same issue when an instance goes down. If I kill a tomcat instance (something like kill -3) it takes some time (around 2 minutes) for HornetQ to deliver the failed message to another instance.
What am I missing? How can we configure hornetQ so that the load balancing is more reactive to listeners on the queue?
Thanks,
Stéphane