mirror of https://github.com/apache/activemq.git
try and allow for zero pretech consumers with lazy dispatch
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@636507 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
290ce2a6bf
commit
93ccb9ca3b
|
@ -1097,12 +1097,18 @@ public class Queue extends BaseDestination implements Task {
|
|||
|
||||
private int getConsumerMessageCountBeforeFull() throws Exception {
|
||||
int total = 0;
|
||||
boolean zeroPrefetch = false;
|
||||
synchronized (consumers) {
|
||||
for (Subscription s : consumers) {
|
||||
total += ((PrefetchSubscription) s).countBeforeFull();
|
||||
PrefetchSubscription ps = (PrefetchSubscription) s;
|
||||
zeroPrefetch |= ps.getPrefetchSize() == 0;
|
||||
int countBeforeFull = ps.countBeforeFull();
|
||||
total += countBeforeFull;
|
||||
}
|
||||
}
|
||||
|
||||
if (total==0 && zeroPrefetch){
|
||||
total=1;
|
||||
}
|
||||
return total;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue