Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 20FC97A94 for ; Mon, 5 Dec 2011 14:50:53 +0000 (UTC) Received: (qmail 92327 invoked by uid 500); 5 Dec 2011 14:50:52 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 92305 invoked by uid 500); 5 Dec 2011 14:50:52 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 92297 invoked by uid 99); 5 Dec 2011 14:50:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Dec 2011 14:50:52 +0000 X-ASF-Spam-Status: No, hits=0.6 required=5.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of abdelmonem.faleh@gmail.com designates 209.85.214.43 as permitted sender) Received: from [209.85.214.43] (HELO mail-bw0-f43.google.com) (209.85.214.43) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 05 Dec 2011 14:50:46 +0000 Received: by bkbzs2 with SMTP id zs2so1595964bkb.2 for ; Mon, 05 Dec 2011 06:50:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=UB6ASHDNmvktrfqEIX0mbsv1/kDdW4m6PtUq8Cz5H48=; b=tQhDBUP4dBAcsPzzDtIApUWhO6qQ2mla4AGoUUfeC+nR6IpOAjADuR6KtoRgj1m0FK GJYMV4WxO30z6hZizc402huk9byRGRhAnNdRBgXH8QNt1EALpmFiYFMohiTaSrOF7LO/ iXCEX3o9jApCBTNZb7eo1NuENuL/BtDWk59Io= MIME-Version: 1.0 Received: by 10.216.133.197 with SMTP id q47mr2433324wei.111.1323096626037; Mon, 05 Dec 2011 06:50:26 -0800 (PST) Received: by 10.216.162.9 with HTTP; Mon, 5 Dec 2011 06:50:25 -0800 (PST) In-Reply-To: <1323053205.28421.YahooMailNeo@web39314.mail.mud.yahoo.com> References: <1322753155416-4128926.post@n4.nabble.com> <1323053205.28421.YahooMailNeo@web39314.mail.mud.yahoo.com> Date: Mon, 5 Dec 2011 15:50:25 +0100 Message-ID: Subject: Re: Multiple war in Tomcat 7 using a shared embedded ActiveMQ From: Daoud Abdelmonem Faleh To: users@activemq.apache.org, Claudio Corsi Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org What about Apache TomEE? http://openejb.apache.org/apache-tomee.html On Mon, Dec 5, 2011 at 3:46 AM, Claudio Corsi wrote: > Hi Dysan, > > I am not a tomcat expert but just looking at the server.xml file.=A0 Ther= e 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. > > http://tomcat.apache.org/tomcat-7.0-doc/api/org/apache/catalina/Lifecycle= Listener.html > > It receives a lifecycleevent instance that you can use to determine in wh= ich cycle the tomcat server is currently processing. > > > Looking at the javadoc you should be able to determine which lifecycle ev= ent you should start the broker on and which cycle event you should shutdow= n the server. > > You could then define a mechanism to determine which connection informati= on you should use to connect to the broker. > > This is just part of the general v7 javadoc located at: > > http://tomcat.apache.org/tomcat-7.0-doc/api/index.html > > > Hope this helps, > > --Claudio > > > >>________________________________ >> From: Dysan >>To: users@activemq.apache.org >>Sent: Thursday, December 1, 2011 10:25 AM >>Subject: Multiple war in Tomcat 7 using a shared embedded ActiveMQ >> >>Hi, >> >>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 sam= e >>Tomcat. >> >>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 g= et >>my activemq connection with a lookup. The first connection to the broker >>implicitly starts it. But with this method I run into various problems li= ke >>instance already existing or locks in data store. >> >>Should I use instead an additional war which uses a BrokerFactory to star= t >>the broker explicitly ? In this case how to make sure that this war execu= tes >>first in Tomcat ? And how do I stop my broker and where ? >> >>Thanks for the help. >> >> >>-- >>View this message in context: http://activemq.2283324.n4.nabble.com/Multi= ple-war-in-Tomcat-7-using-a-shared-embedded-ActiveMQ-tp4128926p4128926.html >>Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> >>