[ https://issues.apache.org/activemq/browse/AMQ-855?page=all ]

Vadim Pesochinskiy updated AMQ-855:
-----------------------------------

    Attachment: PrefetchSubscription.java.patch2

Almost resolved :-). There 2 minor but significant changes. 

1.      pullMessage(). Changed:

prefetchExtension++ to prefetchExtension=1  The problem with increment is that 
when message is rolled back by client, consumer will call receive*() again and 
that will make prefetchExtension 2 and the window will be open permanently 
again, i.e. goes back to push instead of pull. In case of roll back client does 
not really need to pull, but there is not much harm in it.

2.      acknowledge(ConnectionContext, MessageAck). Changed as follows:
   
     line 191:
     ++ if (getPrefetchSize() != 0) {
           prefetchExtension=Math.max(prefetchExtension,index+1);
     ++ }

What happens here is when standard ack is received window is         extended 
to push more messages, which we do not need in pulling client situation.

> Add support for prefetchSize = 0
> --------------------------------
>
>                 Key: AMQ-855
>                 URL: https://issues.apache.org/activemq/browse/AMQ-855
>             Project: ActiveMQ
>          Issue Type: New Feature
>          Components: Broker
>    Affects Versions: 4.0, 4.0.1, 4.0.2
>         Environment: any
>            Reporter: Vadim Pesochinskiy
>         Assigned To: Hiram Chirino
>            Priority: Critical
>             Fix For: 4.1
>
>         Attachments: ActiveMQMessageConsumer.patch, 
> ActiveMQMessageConsumer.patch2, PrefetchSubscription.java.patch2, 
> PrefetchSubscription.patch, region.QueueSubscription.java.patch, 
> ZeroPrefetchConsumerTest.java.patch
>
>
> 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: 
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira


Reply via email to