ARTEMIS-1604 Using default supportDirectDelivery=false
This is to avoid races setting it to false on protocols that won't support direct Deliver
This commit is contained in:
parent
c83fce8db4
commit
0872f749a9
|
@ -253,7 +253,7 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
|
|||
|
||||
private volatile boolean directDeliver = true;
|
||||
|
||||
private volatile boolean supportsDirectDeliver = true;
|
||||
private volatile boolean supportsDirectDeliver = false;
|
||||
|
||||
private AddressSettingsRepositoryListener addressSettingsRepositoryListener;
|
||||
|
||||
|
@ -1078,9 +1078,13 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
|
|||
throw ActiveMQMessageBundle.BUNDLE.maxConsumerLimitReachedForQueue(address, name);
|
||||
}
|
||||
|
||||
if (consumers.isEmpty()) {
|
||||
this.supportsDirectDeliver = consumer.supportsDirectDelivery();
|
||||
} else {
|
||||
if (!consumer.supportsDirectDelivery()) {
|
||||
this.supportsDirectDeliver = false;
|
||||
}
|
||||
}
|
||||
|
||||
cancelRedistributor();
|
||||
ConsumerHolder<Consumer> newConsumerHolder = new ConsumerHolder<>(consumer);
|
||||
|
@ -1158,6 +1162,9 @@ public class QueueImpl extends CriticalComponentImpl implements Queue {
|
|||
}
|
||||
|
||||
private boolean checkConsumerDirectDeliver() {
|
||||
if (consumers.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
boolean supports = true;
|
||||
for (ConsumerHolder consumerCheck : consumers) {
|
||||
if (!consumerCheck.consumer.supportsDirectDelivery()) {
|
||||
|
|
Loading…
Reference in New Issue