activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chinshaw <chris.hins...@gmail.com>
Subject Lengthy delays when using ActiveMQ Ajax Client
Date Mon, 07 Apr 2014 21:25:04 GMT
I posted this earlier on stackoverflow.com but this may be a better place to
get some advice. 
I think my question simplified is should messages be received by the browser
before the end of the timeout because if a message sent is not recieved
before the timeout of the connection. If I set the timeout for example to
two seconds in the javascript initialization the message is received at the
end of the 2 second timeout. I was expecting the onsuccess to be called when
a message is received and the connection to reconnect but this is not the
case as I am experiencing.

  

I am testing the basic ActiveMQ AjaxServlet service to communicate with a
back end ActiveMQ service. The issue I am having is that the time it takes
to receive the message from the queue using the ajax client is sometimes 20+
seconds. The length of the delay is completely different every time but it
is long enough that I am concerned about going forward with the solution. I
have tried the prototype adapter and the jquery adapter and both exhibit the
same issues. I have tried multiple browsers and the same issues persists. I
have excellent connectivity with the remote queue and there is no delay
there. 


**Edit**<br/>

I see that the message is being delayed 25 seconds which is the timeout of
the ajax connection. I don't think this is the correct behavior and it
should break when the message is received,then reconnect. Is this the
correct assumption?




ActiveMQ Version : 5.9.0 <br/>
Firefox: 28 <br/>
Chrome: Newest Release <br/>
Tomcat: 7.0.52


**web.xml**

	<context-param>
		<param-name>org.apache.activemq.brokerURL</param-name>
		<param-value>tcp://remoteaddress.example:61616</param-value>
	</context-param>

	<servlet>
		<servlet-name>AjaxServlet</servlet-name>
		<servlet-class>org.apache.activemq.web.AjaxServlet</servlet-class>
		<async-supported>true</async-supported>
	</servlet>

	<servlet>
		<servlet-name>MessageServlet</servlet-name>
		<servlet-class>org.apache.activemq.web.MessageServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
		<async-supported>true</async-supported>
	</servlet>


	<servlet-mapping>
		<servlet-name>MessageServlet</servlet-name>
		<url-pattern>/q/message/*</url-pattern>
	</servlet-mapping>

	<servlet-mapping>
		<servlet-name>AjaxServlet</servlet-name>
		<url-pattern>/q/ajax/*</url-pattern>
	</servlet-mapping>




**Javascript**

    
    	
    	
    	




--
View this message in context: http://activemq.2283324.n4.nabble.com/Lengthy-delays-when-using-ActiveMQ-Ajax-Client-tp4680130.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Mime
View raw message