Bug 1150127
| Summary: | AMQP 1.0 consumer should be able to get messages from browse-only queue | ||
|---|---|---|---|
| Product: | Red Hat Enterprise MRG | Reporter: | Pavel Moravec <pmoravec> |
| Component: | qpid-cpp | Assignee: | Pavel Moravec <pmoravec> |
| Status: | CLOSED ERRATA | QA Contact: | Petr Matousek <pematous> |
| Severity: | medium | Docs Contact: | |
| Priority: | medium | ||
| Version: | 3.0 | CC: | jross, pematous, zkraus |
| Target Milestone: | 3.2 | ||
| Target Release: | --- | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | |||
| Fixed In Version: | qpid-cpp-0.32-1 | Doc Type: | Bug Fix |
| Doc Text: |
Qpid broker allowed 0-10 consumers on browse-only queues, but did not allow 1.0 consumers to attach to these queues. This caused read-only queues not to work as expected for customers. Improvements to `Queue.h` and `amqp/Session.cpp` now allow 1.0 consumers to attach to browse-only queues. The consumers are marked internally as browsers, which is consistent in behavior to 0-10 consumers.
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2015-10-08 13:09:20 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
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 |
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: