Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 29408 invoked from network); 2 Mar 2007 09:59:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Mar 2007 09:59:15 -0000 Received: (qmail 88783 invoked by uid 500); 2 Mar 2007 09:59:23 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 88737 invoked by uid 500); 2 Mar 2007 09:59:22 -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 88728 invoked by uid 99); 2 Mar 2007 09:59:22 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2007 01:59:22 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of rajdavies@gmail.com designates 64.233.182.190 as permitted sender) Received: from [64.233.182.190] (HELO nf-out-0910.google.com) (64.233.182.190) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 02 Mar 2007 01:59:10 -0800 Received: by nf-out-0910.google.com with SMTP id y38so1227000nfb for ; Fri, 02 Mar 2007 01:58:48 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:mime-version:in-reply-to:references:content-type:message-id:from:subject:date:to:x-mailer; b=EwbQcUbv/6uRoXRSUsz9aMxjmTjrxFCobCJ/C7KCLN8QVfXSpnTVrdEl8Y3EeCOS4S6A+sa5+BV7Ufzezu9hv2enti8Ppx/RI10PIcdJ9lV7f65Q3KVeW4dmyWcXv4OThahKCR7b7N9WyrkBTEjhJl+To26d/Tr9qVoZYtXcZ2o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:mime-version:in-reply-to:references:content-type:message-id:from:subject:date:to:x-mailer; b=c4JmQXOIA5SY7Mv/fmxwLVcVzGy/zWL6lfw6GlqyQO7xgtl7V3eeeEzl+MFCgqQdFbtoHPfK/j/cTsUGPy8s4IQATD/XiaOfYvJeGuTs6vNit4arWc31pJ1XQlla4lj9Ijd6vqjxrabfZOCc8OMrbQO3SbgdzwSeXBSlwwPHPww= Received: by 10.49.10.3 with SMTP id n3mr7387010nfi.1172829528393; Fri, 02 Mar 2007 01:58:48 -0800 (PST) Received: from ?192.168.15.100? ( [86.136.42.154]) by mx.google.com with ESMTP id r34sm11563076nfc.2007.03.02.01.58.45; Fri, 02 Mar 2007 01:58:46 -0800 (PST) Mime-Version: 1.0 (Apple Message framework v752.3) In-Reply-To: <653849d10703011413q6bcf8919x1740491958aea094@mail.gmail.com> References: <4354353.post@talk.nabble.com> <4468F76D.6070607@daxtechnologies.com> <446A046C.8070303@daxtechnologies.com> <446B38FE.9050505@daxtechnologies.com> <446B5AB3.5090000@daxtechnologies.com> <446B7F01.8010502@daxtechnologies.com> <653849d10703011413q6bcf8919x1740491958aea094@mail.gmail.com> Content-Type: multipart/alternative; boundary=Apple-Mail-6--898695786 Message-Id: From: Rob Davies Subject: Re: Remove all messages from a queue Date: Fri, 2 Mar 2007 09:58:36 +0000 To: users@activemq.apache.org X-Mailer: Apple Mail (2.752.3) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-6--898695786 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed for unit tests - we often set the deleteAllMessagesOnStartup flag on the broker For your case where you are using the vm://transport, create the broker separetly in your setUp() - and set the deleteAllMessageOnStartup property on the broker before calling start () or setting a transport connector (for vm:// you won't need to explicitly do this). cheers, Rob Davies http://rajdavies.blogspot.com/ On 1 Mar 2007, at 22:13, Kelly Campbell wrote: > I'm trying to figure out how to do this same thing in the current > codebase (4.1/4.2). Basically I just want to purge all queues at the > beginning of a unit test to ensure a clean start. I have a local vm:// > broker and would prefer not to go through JMX to do this. > > Thanks, > Kelly > > On 5/17/06, Hiram Chirino wrote: >> Correct. >> >> On 5/17/06, Adrian Tarau wrote: >> > Thanks. I presume this purge will remove all the messages from the >> > persistance, right? not only memory... >> > >> > Hiram Chirino wrote: >> > > Yes. That should be a map of ActiveMQDestination to >> > > o.a.a.b.r.Destination objects. >> > > You should be able to do something like ((o.a.a.b.r.Queue) >> > > destination).purge(); >> > > >> > > On 5/17/06, Adrian Tarau wrote: >> > >> >> > >> BrokerServer.getBroker().getDestinationMap() ? >> > >> >> > >> Hiram Chirino wrote: >> > >> > Hi Adrian, >> > >> > >> > >> > If you get a hold of the BrokerServer it should be possible >> navigate >> > >> > the object tree and be able to get a Queue object and ask >> it to delete >> > >> > it's messages. >> > >> > >> > >> > >> > >> > On 5/17/06, Adrian Tarau wrote: >> > >> >> James? Anybody? Help? :) >> > >> >> >> > >> >> Adrian Tarau wrote: >> > >> >> > James? Any suggestions how to clear a queue with >> activemq API >> > >> without >> > >> >> > JMX? Thanks. >> > >> >> > >> > >> >> > Adrian Tarau wrote: >> > >> >> >> I know the utility of JMX, I use it :) But right now I >> don't >> > >> want to >> > >> >> >> activate JMX. I saw that ActiveMQ use MX4J 2.1.1(why >> don't use >> > >> >> >> 3.0.1?) and I have already in my application MX4J 3.0.1 >> > >> libraries and >> > >> >> >> I remember I used 3.0.1 with a project that need 2.1.x >> and was not >> > >> >> >> working. >> > >> >> >> >> > >> >> >> And of course I cannot have two version of MX4J in my >> application. >> > >> >> >> >> > >> >> >> James Strachan wrote: >> > >> >> >>> On 5/15/06, Adrian Tarau wrote: >> > >> >> >>>> Since I use embedded JMS is not necessary to activate >> also JMX, >> > >> >> >>> >> > >> >> >>> JMX is extremely useful. e.g. in JConsole you can >> watch all of >> > >> the >> > >> >> >>> mbeans in an application (the garbage collector, >> number of >> > >> threads, >> > >> >> >>> amount of memory free together wtih the ActiveMQ >> mbeans such >> > >> as all >> > >> >> >>> the destinations & consumers and queue depths etc >> > >> >> >>> >> > >> >> >>> >> > >> >> >>>> and JMX >> > >> >> >>>> MBeans already use those parts to interrogate for >> values outside >> > >> >> >>>> the JMS >> > >> >> >>>> standard. Why not to be accessible with Java code and >> only JMX? >> > >> >> >>> >> > >> >> >>> Everything is accessible via Java code and JMX; the >> reason I >> > >> suggest >> > >> >> >>> JMX is that >> > >> >> >>> >> > >> >> >>> (i) it can work with remote brokers too >> > >> >> >>> (ii) it works great in JConsole - so its really easy >> to look >> > >> at the >> > >> >> >>> mbeans whenever you like (rather than having to write >> Java code) >> > >> >> >>> >> > >> >> >> >> > >> >> > >> > >> >> >> > >> >> >> > >> > >> > >> > >> > >> >> > >> >> > > >> > > >> > >> > >> >> >> -- >> Regards, >> Hiram >> --Apple-Mail-6--898695786--