mirror of
https://github.com/apache/activemq.git
synced 2025-02-20 00:47:07 +00:00
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 {
|
private int getConsumerMessageCountBeforeFull() throws Exception {
|
||||||
int total = 0;
|
int total = 0;
|
||||||
|
boolean zeroPrefetch = false;
|
||||||
synchronized (consumers) {
|
synchronized (consumers) {
|
||||||
for (Subscription s : 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;
|
return total;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user