Pretty new to messaging/JMS on JBoss; need some help.
I am noticing different behaviour for Queue based messaging for a sample queue on JBOSS 4.2.3 and JBOSS 6.
Lets say there is a sample jms queue called "SampleQueue" and consumers consuming messages from it. In a working environment with Jboss 4.2.3 when i add messages to the SampleQueue; the consumers seem to be picking them up instantly.
However the same is not achieved in JBOSS 6.1. What i notice in JBOSS 6.1 is a consumer blocks till it receives acknowledgment or finishes processing for the previous message posted on the queue.
For example:-
If message M1 and M2 are pushed to the queue; in that order; M2 is not picked up by a consumer till "onMessage" call for M1 returns. In other words M2 is not picked up till M1 is processed and an acknowledgment sent.
How can i avoid this?
Its a non transacted; non durable queue we are talking about here. And a producer producing multiple messages with more than one consumer.
What i have tried so far:-
- Sending an explicit ack using the acknowledge method.
- setting "block-on-non-durable-send" to false in the hornetq-jms.xml.
My MDB config looks as below:-
@MessageDriven(activationConfig = { @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"), @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty(propertyName = "destination", propertyValue = "queue/SampleQueue"), @ActivationConfigProperty(propertyName = "messageSelector", propertyValue = "MessageFormat = 'Version 0.1' AND Service = 'SampleImpl'" ) }) @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
I have also tried with maxSessions
mdb property and setting explictly a strict pool of size 10 but to no avail.
Let me know of any other details that i need to add. Help greatly appreciated.