activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bcmoney <>
Subject Running ActiveMQ AJAX and JAVA client listeners
Date Sun, 16 May 2010 01:49:16 GMT

I've already successfully integrated and customized the code for both the
AJAX and JAVA JMS clients. While both have been working well in separate
projects, unfortunately, I'm having a bit of trouble trying to reliably run
an AJAX message listener and JAVA message listener in the same project. 

What I'm trying to do is have JAVA as the failover for when AJAX JMS client
is not listening (i.e. browser is closed). When a browser client opens, the
(constantly running) JAVA client can ignore the messages... but... when no
browser client is initialized, the JAVA client should respond to the
messages on behalf of the AJAX client. I've tried using the
ServletContextListener  which I was hoping would launch the JAVA listener
whenever the Servlet gets initialized (i.e. it would auto-start when Tomcat
gets restarted, or, anytime the Servlet gets redeployed) but it seems Tomcat
is not thread-safe and this might be causing some problems. In any case, I
can't seem to get the JAVA client to reliable start running and stay running
for the lifetime of my AJAX client (servlet .war), and without including
them in the same project and same J2EE container sharing the same
ServletContext, I don't know how its possible to ensure they are running and
starting and stopping at the same time.

Is there perhaps a better way to accomplish this?
View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message