activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <>
Subject Re: Pulling consumer design
Date Thu, 10 Aug 2006 18:48:56 GMT
On 8/10/06, Pesochinskiy, Vadim (MSCIBARRA)
<> wrote:
> James,
> One way to implement this, which I think will fit with current design is
> to introduce a MessagePullCommand, which informs the broker that
> consumer is ready to accept next message. When broker get this request
> it dispatches one message to this consumer. What do you think about
> this?

Good idea. Actually if you check SVN trunk I committed something like
this about an hour ago :)

I'm just committing a test case that shows it working as I type
(ZeroPrefetchConsumerTest) :)

So basically prefetch of zero can be supported for synchronous
consumers (where receive(long) or receive() is called). We throw an
exception if you try and use it for async subscription

The one issue with the current implementation is that the
receive(timeout) must wait long enough for a message to arrive from
the broker; otherwise the method may return but a message is
dispatched just shortly afterwards. So provided you give a reasonably
large receive(timeout) then it should do what you need.



View raw message