You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Alex Dean (JIRA)" <ji...@apache.org> on 2011/02/13 04:10:58 UTC

[jira] Updated: (AMQ-3123) ajax client receives incorrect messages when subscribed to multiple topics

     [ https://issues.apache.org/jira/browse/AMQ-3123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alex Dean updated AMQ-3123:
---------------------------

    Attachment: undelivered_messages_need_associated_consumer.patch

Messages which are buffered for later delivery need to be associated with the correct consumer.

> ajax client receives incorrect messages when subscribed to multiple topics
> --------------------------------------------------------------------------
>
>                 Key: AMQ-3123
>                 URL: https://issues.apache.org/jira/browse/AMQ-3123
>             Project: ActiveMQ
>          Issue Type: Bug
>    Affects Versions: 5.4.2
>            Reporter: Alex Dean
>         Attachments: undelivered_messages_need_associated_consumer.patch
>
>
> When an ajax client is subscribed to multiple topics, the "id" attribute of a returned <response> element indicates to JavaScript which callback function should process the message.  Currently, the MessageListenerServlet returns multiple copies of each message, 1 per subscription.  So all callback functions will receive all messages.
> For example, if I send messages 'A1' and 'A2' to /topic/topicA, and messages 'B1' and 'B2' to /topic/topicB, my ajax client gets the following message:
> <ajax-response>
>   <response id='handlerA' destination='topic://topicA' >A1</response>
>   <response id='handlerA' destination='topic://topicA' >B1</response>
>   <response id='handlerA' destination='topic://topicA' >A2</response>
>   <response id='handlerA' destination='topic://topicA' >B2</response>
>   <response id='handlerB' destination='topic://topicB' >A1</response>
>   <response id='handlerB' destination='topic://topicB' >B1</response>
>   <response id='handlerB' destination='topic://topicB' >A2</response>
>   <response id='handlerB' destination='topic://topicB' >B2</response>
> </ajax-response>
> Further, these messages are constantly re-delivered to the client.  (They are never removed from the unconsumedMessages linked list in AjaxListener.)
> If https://issues.apache.org/jira/secure/attachment/12467757/all_messages_are_delivered_to_ajax_clients.patch from https://issues.apache.org/jira/browse/AMQ-3094 is applied, the duplication is reduced, but the "id" values for the "topicB" messages are still incorrect.
> <ajax-response>
>   <response id='handlerA' destination='topic://topicA' >A1</response>
>   <response id='handlerA' destination='topic://topicA' >B1</response>
>   <response id='handlerA' destination='topic://topicA' >A2</response>
>   <response id='handlerA' destination='topic://topicA' >B2</response>
> </ajax-response>
> I've attached a test which demonstrates the problem.  This patch will conflict with the one attached to AMQ-3094, but the conflicts should be easy to resolve.

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira