qpid-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gordon Sim <g...@redhat.com>
Subject Re: qpid for multiple producers and consumers
Date Fri, 12 Feb 2010 16:52:06 GMT
On 02/11/2010 07:01 AM, Ramashish Baranwal wrote:
> Hi,
>
> I am trying to evaluate qpid for an application with distributed
> producers and consumers. The application has multiple producers and
> multiple consumers, all subscribed to the same queue. The requirement
> is that any consumer should be able to receive a message and process
> it. The message processing takes some time, so while a consumer is
> processing a message other consumers should be able to retrieve other
> messages present in the queue so that the processing can happen in
> parallel by multiple consumers.
>
> It seems this should be easy to do with qpid, but I haven't been able
> to figure out till now. I tried the python examples, direct
> producer/consumer looked like what I wanted till I saw that while one
> consumer is fetching a message, the other consumer is not able to.
> When I close the first consumer, the other consumer picks up from
> where the first consumer left. What I want is a parallel behaviour as
> mentioned above.
>
> I probably have overlooked something. Any ideas, or suggestions?

Try setting flow control such that each consumer only gets one message 
at a time. I.e. instead of calling start() on the incoming queue (which 
gives unlimited credit) allocate credit yourself. (Attached patch 
attempts to describe that more precisely).

--Gordon.

Mime
View raw message