activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alex Dean (JIRA)" <j...@apache.org>
Subject [jira] Created: (AMQ-3123) ajax client receives incorrect messages when subscribed to multiple topics
Date Fri, 07 Jan 2011 21:20:46 GMT
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


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.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message