From a255b0dc43174973ea5376227ab8f2332228eb8e Mon Sep 17 00:00:00 2001 From: Robert Godfrey Date: Tue, 18 Feb 2014 09:32:09 +0000 Subject: QPID-5555 : Fix queue exclusivity issues git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1569245 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'qpid/java') diff --git a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java index e7e45db58b..0135b11fb9 100644 --- a/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java +++ b/qpid/java/broker-core/src/main/java/org/apache/qpid/server/queue/SimpleAMQQueue.java @@ -670,6 +670,11 @@ abstract class SimpleAMQQueue, Q extends SimpleA boolean exclusive = optionSet.contains(Consumer.Option.EXCLUSIVE); boolean isTransient = optionSet.contains(Consumer.Option.TRANSIENT); + if(exclusive && getConsumerCount() != 0) + { + throw new ExistingConsumerPreventsExclusive(); + } + QueueConsumer consumer = new QueueConsumer(filters, messageClass, optionSet.contains(Consumer.Option.ACQUIRES), optionSet.contains(Consumer.Option.SEES_REQUEUES), -- cgit v1.2.1