JBoss Community

Re: JBoss Messaging cluster : Some messages takes 2 to 6 seconds to deliver

created by Sudeep Pillai in JBoss Messaging - View the full discussion

Even with enableTcpNoDelay flag set, we experienced high delayed messages. Finally, root cause was identified. We have multiple Consumers for single message queue listening to Messages in its own threads(one thread per consumer). When a consumer receives a message, its thread process that message and at the end of processing calls consumer.receive(timeout) and waits for the next message. Processing time of a message in consumer threads can vary with some message processing taking few seconds.

 

Problem is JBoss will stream message to the above consumer, which has not called receive method, even though there are other consumers which have called receive method and waiting. If this scenario happens, second message streamed to that consumer will be processed once the consumer thread is free. We avoided this by closing the consumer soon after receive returns a message. When the thread is ready for the next message, create a new consumer and call receive on the new consumer.

 

Hope this helps.

Reply to this message by going to Community

Start a new discussion in JBoss Messaging at Community