You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by quicksilverm26 <em...@yahoo.com> on 2010/08/12 10:20:17 UTC
amq.js not able to do long polling
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 .
http://localhost:8080/queueTest/index.html
index.html
<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);
</script>
_amq.js
The _amq.js was also modified wherein the uri: '/queueTest/amq',
the web.xml is attached .
web.xml
As attached in the post http://old.nabble.com/file/p29415487/web.xml web.xml
QueueProducer
http://old.nabble.com/file/p29415487/AmqDemo.java AmqDemo.java
The queueProducer is being called by the servlet at the startup to generate
couple of messages. The invocation of queueProducer ( The actual class being
AmqDemo.java 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
http://localhost:8080/queueTest/amq/?timeout=10&_=
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
info.
Thanks,
Raj
--
View this message in context: http://old.nabble.com/amq.js-not-able-to-do-long-polling-tp29415487p29415487.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.