You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Timothy Bish (Resolved) (JIRA)" <ji...@apache.org> on 2011/09/27 23:26:47 UTC

[jira] [Resolved] (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 ]

Timothy Bish resolved AMQ-3123.
-------------------------------

       Resolution: Fixed
    Fix Version/s:     (was: NEEDS_REVIEWED)
                   5.5.0

The fixes were applied but this issue seems to have been left open.
                
> 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
>             Fix For: 5.5.0
>
>         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.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira