activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prgtrdr <prgt...@gmail.com>
Subject Possible Bug in AJAX/MessageListenerServlet.java?
Date Thu, 10 Oct 2013 14:14:03 GMT
I've been having a problem with the ActiveMQ AJAX handler and believe I found
a bug, and would like to post here to see if anyone else has run across the
same problem.

I'm using ExtJS to create two separate panels which run in one browser tab. 
After loading jquery, amq_jquery_adapter.js and amq.js I call amq_init (only
once).  Then each panel calls addlistener like so:

Panel 1 code:


Panel 2 code:


Note that both are subscribing to the same topic.  This is because Panel 1
shows the data in a different format than Panel 2.

*The Problem:*
If I start Panel 1 alone, it receives data from the topic without problems.
But then I start Panel 2 and as soon as it executes the addlistener, Panel 2
starts receiving data but Panel 1 stops!  

So I started tracing into the network traffic and all looks fine, i.e, I can
see each addlistener trigger a 'listen' request with the proper id and
topic.  And I see the amq server return data to testconnection1, then stop
suddenly when the 'listen' for testconnection2 is sent.  So I turned my
attention to the backend code and enabled a detailed trace.  Here's what I
found:

When the Panel 1 'listen' is received, the trace shows:


When the Panel 2 'listen' is received, I see this trace:


SO what is happening is that in MessageListenerServlet.js, function doPost,
line 165 is dropping any previous consumer to the same destination:


But why?  There doesn't seem to be a good reason for doing this--maybe it
was originally put there for cleanup purposes?.  Or if there is a good
reason, maybe the behavior should be to not do it if the id of the new
destination (in this case 'testconnection2') is different than the id of the
existing destination ('testconnection1').

I can try to figure out a patch but want to see if I'm missing something
obvious before I spend further time on this.  Thanks in advance for any
help.



--
View this message in context: http://activemq.2283324.n4.nabble.com/Possible-Bug-in-AJAX-MessageListenerServlet-java-tp4672543.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message