You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by "Ken Giusti (JIRA)" <qp...@incubator.apache.org> on 2010/04/06 16:42:33 UTC

[jira] Created: (QPID-2482) Topic Exchange can duplicate messages.

Topic Exchange can duplicate messages.
--------------------------------------

                 Key: QPID-2482
                 URL: https://issues.apache.org/jira/browse/QPID-2482
             Project: Qpid
          Issue Type: Bug
          Components: C++ Broker
         Environment: Linux
            Reporter: Ken Giusti


As per Gordon's description:

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.

Steps to Reproduce:
1. create queue
2. bind it to amq.topic with two distinct bindings (e.g. red.* and *.herring)
3. send amq.topic a message whose routing key matches both patterns (e.g. "red.herring")
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.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-2482) Topic Exchange can duplicate messages.

Posted by "Emmanuel Bourg (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-2482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12855314#action_12855314 ] 

Emmanuel Bourg commented on QPID-2482:
--------------------------------------

The same issue exists with the Java broker (version 0.6). The examples in org.apache.qpid.example.amqpexample.pubsub exhibit this behavior.

> Topic Exchange can duplicate messages.
> --------------------------------------
>
>                 Key: QPID-2482
>                 URL: https://issues.apache.org/jira/browse/QPID-2482
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>         Environment: Linux
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>
> As per Gordon's description:
> 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.
> Steps to Reproduce:
> 1. create queue
> 2. bind it to amq.topic with two distinct bindings (e.g. red.* and *.herring)
> 3. send amq.topic a message whose routing key matches both patterns (e.g. "red.herring")
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Assigned: (QPID-2482) Topic Exchange can duplicate messages.

Posted by "Ken Giusti (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-2482?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ken Giusti reassigned QPID-2482:
--------------------------------

    Assignee: Ken Giusti

> Topic Exchange can duplicate messages.
> --------------------------------------
>
>                 Key: QPID-2482
>                 URL: https://issues.apache.org/jira/browse/QPID-2482
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>         Environment: Linux
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>
> As per Gordon's description:
> 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.
> Steps to Reproduce:
> 1. create queue
> 2. bind it to amq.topic with two distinct bindings (e.g. red.* and *.herring)
> 3. send amq.topic a message whose routing key matches both patterns (e.g. "red.herring")
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-2482) Topic Exchange can duplicate messages.

Posted by "Ken Giusti (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-2482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856025#action_12856025 ] 

Ken Giusti commented on QPID-2482:
----------------------------------

Good catch, Emmanuel.  I'd like to open up a new jira to track the java issue separately.  I'm not very experienced with that implementation.   

thanks,

-K


> Topic Exchange can duplicate messages.
> --------------------------------------
>
>                 Key: QPID-2482
>                 URL: https://issues.apache.org/jira/browse/QPID-2482
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>         Environment: Linux
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>
> As per Gordon's description:
> 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.
> Steps to Reproduce:
> 1. create queue
> 2. bind it to amq.topic with two distinct bindings (e.g. red.* and *.herring)
> 3. send amq.topic a message whose routing key matches both patterns (e.g. "red.herring")
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-2482) Topic Exchange can duplicate messages.

Posted by "Rob Godfrey (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-2482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856030#action_12856030 ] 

Rob Godfrey commented on QPID-2482:
-----------------------------------

Emmanuel - can you give the explicit steps you used to reproduce this behaviour in the Java Broker...

Looking at the code for the TopicExchange it should already eliminate duplicate queues (the queues are collated in a Set)

> Topic Exchange can duplicate messages.
> --------------------------------------
>
>                 Key: QPID-2482
>                 URL: https://issues.apache.org/jira/browse/QPID-2482
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>         Environment: Linux
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>
> As per Gordon's description:
> 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.
> Steps to Reproduce:
> 1. create queue
> 2. bind it to amq.topic with two distinct bindings (e.g. red.* and *.herring)
> 3. send amq.topic a message whose routing key matches both patterns (e.g. "red.herring")
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Resolved: (QPID-2482) Topic Exchange can duplicate messages.

Posted by "Ken Giusti (JIRA)" <qp...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/QPID-2482?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Ken Giusti resolved QPID-2482.
------------------------------

    Resolution: Fixed

Ensure only one instance of a given queue appears on the routing list.

> Topic Exchange can duplicate messages.
> --------------------------------------
>
>                 Key: QPID-2482
>                 URL: https://issues.apache.org/jira/browse/QPID-2482
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>         Environment: Linux
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>
> As per Gordon's description:
> 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.
> Steps to Reproduce:
> 1. create queue
> 2. bind it to amq.topic with two distinct bindings (e.g. red.* and *.herring)
> 3. send amq.topic a message whose routing key matches both patterns (e.g. "red.herring")
> 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.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-2482) Topic Exchange can duplicate messages.

Posted by "Emmanuel Bourg (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-2482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856060#action_12856060 ] 

Emmanuel Bourg commented on QPID-2482:
--------------------------------------

Sorry for the false report, I misunderstood the behavior of the example. I saw the messages twice and assumed that was the same issue reported here. But in this case there is one queue with several bindings, whereas the example uses several queues with only one binding. 

Maybe changing the example to use only one queue would avoid the confusion.

> Topic Exchange can duplicate messages.
> --------------------------------------
>
>                 Key: QPID-2482
>                 URL: https://issues.apache.org/jira/browse/QPID-2482
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>         Environment: Linux
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>
> As per Gordon's description:
> 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.
> Steps to Reproduce:
> 1. create queue
> 2. bind it to amq.topic with two distinct bindings (e.g. red.* and *.herring)
> 3. send amq.topic a message whose routing key matches both patterns (e.g. "red.herring")
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org


[jira] Commented: (QPID-2482) Topic Exchange can duplicate messages.

Posted by "Robbie Gemmell (JIRA)" <qp...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/QPID-2482?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12856050#action_12856050 ] 

Robbie Gemmell commented on QPID-2482:
--------------------------------------

I too looked at the code and didnt see how this could occur on the Java broker, and having tried the example was not able to reproduce any problem with the example.

There are 4 queues created by the TopicListener in the example, bound to amp.topic with a specific binding key:
listener.prepareQueue(session,"usa", "usa.#");
listener.prepareQueue(session,"europe", "europe.#");
listener.prepareQueue(session,"news", "#.news");
listener.prepareQueue(session,"weather", "#.weather");
 
The TopicPublisher in the example then sends 4 sets of messages whereby the topic each message is sent to matches exactly two of the bindings for the 4 queues above, eg 'usa.#' and '#.news' in the first set of messages sent:
publisher.publishMessages(session, "usa.news");
publisher.publishMessages(session, "usa.weather");
publisher.publishMessages(session, "europe.news");
publisher.publishMessages(session, "europe.weather");

The log output from the listener shows it recieving twice as many times as there are messages sent, reflecting that 2 queues match each message and sent. I dont see any indication that the same queue recieved the same message twice.

 


> Topic Exchange can duplicate messages.
> --------------------------------------
>
>                 Key: QPID-2482
>                 URL: https://issues.apache.org/jira/browse/QPID-2482
>             Project: Qpid
>          Issue Type: Bug
>          Components: C++ Broker
>         Environment: Linux
>            Reporter: Ken Giusti
>            Assignee: Ken Giusti
>
> As per Gordon's description:
> 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.
> Steps to Reproduce:
> 1. create queue
> 2. bind it to amq.topic with two distinct bindings (e.g. red.* and *.herring)
> 3. send amq.topic a message whose routing key matches both patterns (e.g. "red.herring")
> 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.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:dev-subscribe@qpid.apache.org