Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 75910 invoked from network); 20 Feb 2009 07:58:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2009 07:58:00 -0000 Received: (qmail 49237 invoked by uid 500); 20 Feb 2009 07:57:59 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 49219 invoked by uid 500); 20 Feb 2009 07:57:59 -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 49208 invoked by uid 99); 20 Feb 2009 07:57:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Feb 2009 23:57:59 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 20 Feb 2009 07:57:51 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LaQGI-0003or-El for users@activemq.apache.org; Thu, 19 Feb 2009 23:57:30 -0800 Message-ID: <22116313.post@talk.nabble.com> Date: Thu, 19 Feb 2009 23:57:30 -0800 (PST) From: Eric-AWL To: users@activemq.apache.org Subject: Re: Correctly leaving a network of broker In-Reply-To: <3a73c17c0902190301y30f23f8fk9bc3431cd78863d7@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: eric.vincent@atosorigin.com References: <22062875.post@talk.nabble.com> <22083464.post@talk.nabble.com> <3a73c17c0902190301y30f23f8fk9bc3431cd78863d7@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org Hi Gary Yes, it helps me. Thank you. I understand that, if I have a Java reference of the embedded brokerService object, and use brokerService.stop(), I will gracefully quit the network of broker . Good ! It's the main part of my question. You told me that I can continue to use my URI syntax. It's a very good thing for me to have the activemq embedded broker configuration externalized into a standard configuration file. Can you precise how I get a reference on the brokerService that will be created (not started) with such a method, to start and stop it as I want ? Thank you Eric Gary Tully wrote: > > Hi Eirc, > > If you want to access the broker service you should use the > org.apache.activemq.broker.BrokerFactory to create it and return a > reference. The create takes the same uri syntax as a > connectionFactory. > The details can be found at: > http://activemq.apache.org/how-do-i-embed-a-broker-inside-a-connection.html > > stopping the client broker service will gracefully disconnect it from > the server side (networked) broker. You can still use the vm: url to > connect to the broker but you may want to add create=false to the uri > so that you don't end up with two embedded brokers. > > hope this helps, > Gary. > > 2009/2/18 Eric-AWL : >> >> I use xbean reference to an activemq.xml file to read a VM configuration >> on >> each side. >> >> "vm://instance?brokerConfig=xbean:activemq.xml&waitForStart=2" >> >> I like this method because I can switch from internal VM broker to TCP >> external broker very easily and just use JMS to connect to my internal or >> external broker without using ActiveMQ classes. >> >> If I manage ActiveMQ BrokerService Objects myself and manually create a >> broker in my program, Will "brokerService.stop()" stop the internal >> broker >> and allow my client program to stop gracefully without affecting my >> server >> process ? >> >> If yes, is there a way to get a BrokerService JAVA reference for a VM >> broker >> automatically created with an xbean reference to an ActiveMQ.xml file ? >> >> Eric >> >> -- >> View this message in context: >> http://www.nabble.com/Correctly-leaving-a-network-of-broker-tp22062875p22083464.html >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> > > > > -- > http://blog.garytully.com > > Open Source SOA > http://FUSESource.com > > -- View this message in context: http://www.nabble.com/Correctly-leaving-a-network-of-broker-tp22062875p22116313.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.