activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Dean <a...@crackpot.org>
Subject Re: AJAX: Error occurred in poll. HTTP result: 200, status: parsererror
Date Thu, 30 Sep 2010 22:03:08 GMT

On Sep 30, 2010, at 4:53 PM, jule wrote:

> 
> Hi,
> 
> I see the following log message if a poll times out and an empty response is
> received:
> 
> Error occurred in poll. HTTP result: 200, status: parsererror ----->
> amq_jquery_adapter.js:94
> 
> Investigating this with the JS debugging tools shows the brokers response:
> xhr.responseText: "<ajax-response> </ajax-response> "
> xhr.responseXML: null
> 
> The log entry itself would not be a problem, but the default behaviour of
> the amq.js is: It will wait for 5 seconds until it does the next poll. This
> is perfectly fine in case of server-side congestion issues but it will lead
> to a client not receiving messages for 5 seconds after each poll.
> 
> I overcame this issue by setting the 5 seconds error timeout to 0 seconds
> but that can´t be the solution: If the broker or the connection goes down,
> this configuration will lead to a client trying to poll as fast as it can
> (you´ll have thousands of tries within seconds). 
> 
> Is this a known issue? Does anybody see the same?
> 

The current ajax code doesn't set a Content-Type header when the response is empty.  The client
gets a Content-Type header of 'text/plain', which causes jQuery to not populate response.responseXML.
 So even though XML is being returned, jquery doesn't recognize it as such.

The fix for this (which is just to move 2 lines of code, so Content-Type is always set to
'text/xml') is in https://issues.apache.org/activemq/browse/AMQ-2948.

alex
Mime
View raw message