activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "james strachan (JIRA)" <>
Subject [jira] Resolved: (AMQ-855) Add support for prefetchSize = 0
Date Thu, 10 Aug 2006 18:48:23 GMT
     [ ]

james strachan resolved AMQ-855.

    Fix Version/s: 4.1
                       (was: 4.2)
       Resolution: Fixed

I've just committed an implementation to the main trunk if you want to try it out - or take
a look at the test case 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.

Note that the receiveNoWait() method does not try to pull messages from the broker since the
method is not meant to wait for one to arrive.

> Add support for prefetchSize = 0
> --------------------------------
>                 Key: AMQ-855
>                 URL:
>             Project: ActiveMQ
>          Issue Type: New Feature
>          Components: Broker
>    Affects Versions: 4.0, 4.0.1, 4.0.2
>         Environment: any
>            Reporter: Vadim Pesochinskiy
>            Priority: Critical
>             Fix For: 4.1
> This feature would enable to support following test case:
> 2 servers are processing 3 submitted jobs with following processing times 10 min, 1 min,
1 min. This sequence should finish in 10 minutes as one service will pick up the 10 minutes
job, meanwhile the other one should manage the two 1 minute jobs. Since I cannot set prefetchSize=0,
one of the 1 minute jobs is sitting in prefetch buffer and the jobs are processed in 11 minutes
instead of 10.
> This is simplification of the real scenario where I have about 30 consumers submitting
jobs to 20 consumers through AMQ 4.0.1. I have following problems:
> • Messages are sitting in prefetch buffer are not available to processors, which results
in a lot of idle time.
> • Order of processing is random. For some reason Job # 20 is processed after Job # 1500.
Since senders are synchronously blocked this can result in time-outs.
> • Some requests are real-time, i.e. there is a user waiting, so the system cannot wait,
so AMQ-850 does not fix this issue.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message