activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From quicksilverm26 <>
Subject amq.js not able to do long polling
Date Thu, 12 Aug 2010 08:20:17 GMT

I am trying all that I can to get the integration between actvemq and jetty
going for javascript. I can otherwise any other servlet ( for ex.
MyQueueServlet as mentioned in the docs for activemq\jetty at the site. ) 

I am now trying to queue a few messages using queue with MessageProducer. At
the backend I can see that messages are properly produced and consumed. The
issue is that I am not able to do the same thing in javascript. 

ActiveMQ is running as vm://localhost. 

I have the following lines in index.html of queueTest context .

<script type="text/javascript">amq.uri = '/queueTest/amq';</script>
<script type="text/javascript">
var myHandler = {
    rcvMessage : function(message) {
   alert("received " + message);
 var myId = 'testQueue';
 amq.addListener(myId, 'channel://myQueue', myHandler.rcvMessage);


The _amq.js was also modified wherein the uri: '/queueTest/amq',

the web.xml is attached . 

As attached in the post web.xml 


The queueProducer is being called by the servlet at the startup to generate
couple of messages. The invocation of queueProducer ( The actual class being is in a separate thread context)

FireBug Info : 
destination=channel://myQueue&message=testQueue&type=listen is the post by
http://localhost:8080/queueTest/amq . This is followed by the timeout get
request and 


both the request are returning with the status 200 but are showing
fileSystem data and not the Ajax Response. 

The data which is returned has request.responseXML as null and a little bit
debugging show that it is coming from line 77 of _amq.js

Could anyone help me in this. I am sure this shouldn't have taken this much
amount of time but unfortunately I am not able to go past this. 

Please let me know if anyone has clues. Let me know if you need any other


View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message