Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 579681

Summary: Topic exchange duplicates messages
Product: Red Hat Enterprise MRG Reporter: Gordon Sim <gsim>
Component: qpid-cppAssignee: Ken Giusti <kgiusti>
Status: CLOSED ERRATA QA Contact: Frantisek Reznicek <freznice>
Severity: medium Docs Contact:
Priority: high    
Version: 1.2CC: esammons, freznice
Target Milestone: 1.3   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
In a queue with multiple bindings to the same topic exchange, attempting to deliver a message with a routing key that matched more than one of these bindings caused such message to be delivered multiple times. To prevent this behavior, the broker now tracks all queues to which the message is routed, and no longer sends it to the same queue more than once.
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-10-14 16:08:01 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 568838    

Description Gordon Sim 2010-04-06 09:10:32 UTC
Description of problem:

If a given queue is bound to a topic exchange with multiple bindings, a message sent to that exchange will result in a copy being enqueued for each binding that matches. This is incorrect - each message should be enqueued once if there is any binding to the queue that matches it.

Version-Release number of selected component (if applicable):

1.2 and probably earlier

How reproducible:

100%

Steps to Reproduce:
1. create queue
2. bind it to amq.topic with two distinct bindings (e.g. red.* and *.hat)
3. send amq.topic a message whose routing key matches both patterns (e.g. red.hat)
4. check the queue
  
Actual results:

The message is enqueued on the queue twice.

Expected results:

The message should only be enqueued on the queue once.

Additional info:

Comment 1 Ken Giusti 2010-04-06 18:21:24 UTC
Fix submitted upstream:

http://svn.apache.org/viewcvs?view=rev&rev=931257

Comment 3 Frantisek Reznicek 2010-09-30 12:32:34 UTC
The issue has been fixed, tested on RHEL 4.8 / 5.5 i386 / x86_64 on packages:
python-qmf-0.7.946106-13.el5
python-qpid-0.7.946106-14.el5
qmf-*0.7.946106-17.el5
qpid-cpp-*-0.7.946106-17.el5
qpid-dotnet-0.4.738274-2.el5
qpid-java-*-0.7.946106-10.el5
qpid-tools-0.7.946106-11.el5
ruby-qmf-0.7.946106-17.el5
ruby-qpid-0.7.946106-2.el5


-> VERIFIED

Comment 4 Ken Giusti 2010-10-05 15:38:20 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
* Cause:  Binding a queue multiple times to a topic exchange and delivering a message with a routing key that matches more than one of the bindings.
* Consequence:  A copy of the message is queued for each matching binding, resulting in message duplication.
* Fix:  The broker will track which queues the message is delivered to, and remove duplicate queues.
* Result: One copy of the message will be delivered to the queue regardless of the number of matched bindings.

Comment 5 Jaromir Hradilek 2010-10-06 13:29:01 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,4 +1 @@
-* Cause:  Binding a queue multiple times to a topic exchange and delivering a message with a routing key that matches more than one of the bindings.
+In a queue with multiple bindings to the same topic exchange, attempting to deliver a message with a routing key that matched more than one of these bindings caused such message to be delivered multiple times. To prevent this behavior, the broker now tracks all queues to which the message is routed, and no longer sends it to the same queue more than once.-* Consequence:  A copy of the message is queued for each matching binding, resulting in message duplication.
-* Fix:  The broker will track which queues the message is delivered to, and remove duplicate queues.
-* Result: One copy of the message will be delivered to the queue regardless of the number of matched bindings.

Comment 7 errata-xmlrpc 2010-10-14 16:08:01 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2010-0773.html