On 5 Oct 2010, at 04:23, [email protected] wrote:
I am using qpid-java 0.6. I setup a listener listening on a queue. The
onMessage method will take 10 seconds to finish its job. If there are many messages come to the queue, the onMessage will be called after the previous onMessage call finished. What I want to do is to let qpid client support the
multi-thread dispatch. Does it support this functionality or I should
implement it in onMessage?

Hi.

Why not have a look at the Spring 'DefaultMessageListenerContainer', which allows multi-threaded consume using a customised listener interface? It simply polls in a tight loop, and hands off the messages to a processor thread that implements the Spring listener. The class hierarchy is fairly complex, but the Spring JMS mechanisms are very robust, and I would recommend it if you want an easy way to interface with Qpid.

Andrew.
--
-- andrew d kennedy ? do not fold, bend, spindle, or mutilate ;
-- http://grkvlt.blogspot.com/ ? edinburgh : +44 7941 197 134 ;


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:[email protected]

Reply via email to