activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Dean <a...@crackpot.org>
Subject Re: Problem with Ajax API
Date Tue, 21 Dec 2010 17:25:49 GMT

On Dec 21, 2010, at 11:07 AM, stratio wrote:

> 
> 
> Alex Dean-2 wrote:
>> 
>> What's returned by the server?  Is it maybe one of these?
>> * "<ajax-response></ajax-response>" : This is what a timeout looks like.

>> No messages received.
>> * "<ajax-response><response id='test'
>> destination='topic://topic/ActiveMQFeed' ></response></ajax-response>"
:
>> This is what it looks like when the server delivers a binary message.
>> 
> 
> How can i see what's the return from the server?

FF + Firebug will show you all your ajax traffic.  I don't use Chrome much, but I believe
there's similar functionality available.
http://stackoverflow.com/questions/1820927/request-monitoring-in-chrome

> 
> It seems like that this is the troubled instruction :
> 
> amq.init({ uri: 'amq', logging: true, timeout: 45 });
> 
> in fact if i comment all of the other instructions following it i get the
> same error i posted before.

OK.  Good to know that's where the error is occurring.  addListener() sends a POST to the
server.  You should get a 200 response with an empty response body.

A path like "amq.init({ uri:'amq' })" will be relative to the HTML page it's embedded in.

The <script> tags you quoted differ from the example at http://activemq.apache.org/ajax.html
 '<script type="text/javascript" src="amq.js"></script>'
instead of '<script type="text/javascript" src="js/amq.js"></script>'.

By default, the ajax servlet is listening on http://localhost:8161/demo/amq.  If you're browsing
to http://localhost:8161/demo/js/your-script.html, then you'll need "amq.init({ uri:'../amq'
})".

Does that work?

alex


Mime
View raw message