Description of problem: Qpid broker allows 0-10 consumers on browse-only queues, but does not allow 1.0 consumers there. It should allow 1.0 consumers as well, marking them internally as browsers instead (like it does for 0-10 consumer). Version-Release number of selected component (if applicable): qpid-cpp 0.22-49 How reproducible: 100% Steps to Reproduce: 1. service qpidd restart 2. qpid-config add queue q --argument=qpid.browse-only=true --limit-policy=ring --max-queue-count=100 3. qpid-send -a q -m1 4. qpid-receive -a q # works fine 5. qpid-receive -a q --connection-option "{protocol:amqp1.0}" Actual results: Step 5 returns: qpid-receive: Link detached by peer with amqp:internal-error: not-allowed: Queue q is browse only. Refusing acquiring consumer. (/home/pmoravec/qpid-trunk/qpid/cpp/src/qpid/broker/Queue.cpp:552) Expected results: Both 4. and 5. to return one message (one empty line corresponding to empty message content). Additional info:
Potential patch: Index: cpp/src/qpid/broker/Queue.h =================================================================== --- cpp/src/qpid/broker/Queue.h (revision 1633165) +++ cpp/src/qpid/broker/Queue.h (working copy) @@ -387,6 +387,7 @@ inline const QueueSettings& getSettings() const { return settings; } inline const qpid::framing::FieldTable& getEncodableSettings() const { return encodableSettings; } inline bool isAutoDelete() const { return settings.autodelete; } + inline bool isBrowseOnly() const { return settings.isBrowseOnly; } QPID_BROKER_EXTERN bool canAutoDelete() const; QPID_BROKER_EXTERN void scheduleAutoDelete(); QPID_BROKER_EXTERN bool isDeleted() const; Index: cpp/src/qpid/broker/amqp/Session.cpp =================================================================== --- cpp/src/qpid/broker/amqp/Session.cpp (revision 1633165) +++ cpp/src/qpid/broker/amqp/Session.cpp (working copy) @@ -464,7 +464,7 @@ if (node.queue) { authorise.outgoing(node.queue); - SubscriptionType type = pn_terminus_get_distribution_mode(source) == PN_DIST_MODE_COPY ? BROWSER : CONSUMER; + SubscriptionType type = (pn_terminus_get_distribution_mode(source) == PN_DIST_MODE_COPY) || (node.queue->isBrowseOnly()) ? BROWSER : CONSUMER; if (type == CONSUMER && node.queue->hasExclusiveOwner() && !node.queue->isExclusiveOwner(this)) { throw Exception(qpid::amqp::error_conditions::PRECONDITION_FAILED, std::string("Cannot consume from exclusive queue ") + node.queue->getName()); }
Committed revision 1633798.
(In reply to Pavel Moravec from comment #3) > Committed revision 1633798. Committed revisions: 1633798 and 1633817. (originally I forgot to commit changes in one file)
This issue has been fixed. Verified on rhel6.7 (x86_64, i386) and rhel7.1 (x86_64). packages: qpid-cpp-*-0.34-1 -> VERIFIED
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHEA-2015-1879.html