activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claudio Corsi <>
Subject Re: Multiple war in Tomcat 7 using a shared embedded ActiveMQ
Date Mon, 05 Dec 2011 02:46:45 GMT
Hi Dysan,

I am not a tomcat expert but just looking at the server.xml file.  There is the concept of
a listener that you might want to consider as a way to start/stop the activemq broker.

Here is a pointer to the javadoc.

It receives a lifecycleevent instance that you can use to determine in which cycle the tomcat
server is currently processing.  

Looking at the javadoc you should be able to determine which lifecycle event you should start
the broker on and which cycle event you should shutdown the server.

You could then define a mechanism to determine which connection information you should use
to connect to the broker.

This is just part of the general v7 javadoc located at:

Hope this helps,


> From: Dysan <>
>Sent: Thursday, December 1, 2011 10:25 AM
>Subject: Multiple war in Tomcat 7 using a shared embedded ActiveMQ
>I'm working on a project where several war inside a tomcat 7 have to
>communicate with a single embedded activeMQ (5.5.1) broker inside the same
>I'm wondering what was the best practice to manage this and how to start and
>stop the broker properly.
>Actually i try tu use a global JNDI entry in server.xml and in each war get
>my activemq connection with a lookup. The first connection to the broker
>implicitly starts it. But with this method I run into various problems like
>instance already existing or locks in data store.
>Should I use instead an additional war which uses a BrokerFactory to start
>the broker explicitly ? In this case how to make sure that this war executes
>first in Tomcat ? And how do I stop my broker and where ? 
>Thanks for the help.
>View this message in context:
>Sent from the ActiveMQ - User mailing list archive at
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message