diff options
author | Michael Goulish <mgoulish@apache.org> | 2012-09-10 17:23:34 +0000 |
---|---|---|
committer | Michael Goulish <mgoulish@apache.org> | 2012-09-10 17:23:34 +0000 |
commit | e52a541376a423d88a2ff400f15fdb33fa9d426d (patch) | |
tree | e1d02be5f369fd53b352536e51fa21eaba447064 /cpp/src/qpid/broker/Queue.cpp | |
parent | 874003b6630155aae68dbe638cd4ecf8715b0310 (diff) | |
download | qpid-python-e52a541376a423d88a2ff400f15fdb33fa9d426d.tar.gz |
Jira QPID-4142
browse-only queues
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1382991 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/Queue.cpp')
-rw-r--r-- | cpp/src/qpid/broker/Queue.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/cpp/src/qpid/broker/Queue.cpp b/cpp/src/qpid/broker/Queue.cpp index 0dd4cb7b10..b7096b5ea0 100644 --- a/cpp/src/qpid/broker/Queue.cpp +++ b/cpp/src/qpid/broker/Queue.cpp @@ -206,6 +206,10 @@ Queue::Queue(const string& _name, const QueueSettings& _settings, brokerMgmtObject->inc_queueCount(); } } + + if ( settings.isBrowseOnly ) { + QPID_LOG ( info, "Queue " << name << " is browse-only." ); + } } Queue::~Queue() @@ -483,6 +487,11 @@ void Queue::consume(Consumer::shared_ptr c, bool requestExclusive) // Check for exclusivity of acquiring consumers. size_t acquiringConsumers = consumerCount - browserCount; if (c->preAcquires()) { + if(settings.isBrowseOnly) { + throw NotAllowedException( + QPID_MSG("Queue " << name << " is browse only. Refusing acquiring consumer.")); + } + if(exclusive) { throw ResourceLockedException( QPID_MSG("Queue " << getName() |