https://issues.apache.org/jira/browse/AMQ-3218 - exclusive consumer with highest priority should always get through

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@1082939 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bosanac Dejan 2011-03-18 14:53:44 +00:00
parent cc810aa4da
commit 0de4f88aa7
2 changed files with 2 additions and 4 deletions

View File

@ -417,9 +417,6 @@
</includes> </includes>
<excludes> <excludes>
<exclude>**/perf/SimpleDurableTopicTest.*</exclude> <exclude>**/perf/SimpleDurableTopicTest.*</exclude>
</excludes>
<excludes>
<!-- These tests run too slow to execute as part of the unit tests --> <!-- These tests run too slow to execute as part of the unit tests -->
<exclude>**/TransactionNotStartedErrorTest.*</exclude> <exclude>**/TransactionNotStartedErrorTest.*</exclude>
<exclude>**/DefaultStoreBrokerTest.*</exclude> <exclude>**/DefaultStoreBrokerTest.*</exclude>

View File

@ -392,7 +392,8 @@ public class Queue extends BaseDestination implements Task, UsageListener {
Subscription exclusiveConsumer = dispatchSelector.getExclusiveConsumer(); Subscription exclusiveConsumer = dispatchSelector.getExclusiveConsumer();
if (exclusiveConsumer == null) { if (exclusiveConsumer == null) {
exclusiveConsumer = sub; exclusiveConsumer = sub;
} else if (sub.getConsumerInfo().getPriority() > exclusiveConsumer.getConsumerInfo().getPriority()) { } else if (sub.getConsumerInfo().getPriority() == Byte.MAX_VALUE ||
sub.getConsumerInfo().getPriority() > exclusiveConsumer.getConsumerInfo().getPriority()) {
exclusiveConsumer = sub; exclusiveConsumer = sub;
} }
dispatchSelector.setExclusiveConsumer(exclusiveConsumer); dispatchSelector.setExclusiveConsumer(exclusiveConsumer);