From users-return-27740-apmail-activemq-users-archive=activemq.apache.org@activemq.apache.org Fri Jun 3 22:45:02 2011 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 280216D67 for ; Fri, 3 Jun 2011 22:45:02 +0000 (UTC) Received: (qmail 6040 invoked by uid 500); 3 Jun 2011 22:45:01 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 6006 invoked by uid 500); 3 Jun 2011 22:45:01 -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 5998 invoked by uid 99); 3 Jun 2011 22:45:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 22:45:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gary.tully@gmail.com designates 209.85.216.43 as permitted sender) Received: from [209.85.216.43] (HELO mail-qw0-f43.google.com) (209.85.216.43) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Jun 2011 22:44:55 +0000 Received: by qwf6 with SMTP id 6so1334191qwf.2 for ; Fri, 03 Jun 2011 15:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=XLChylnHr0IiW3An4YdKs7a9WDJ9oeqH/EVkd/+VkVE=; b=MkSrz4Riy6ltd+UybrLG2ZzFE/3um7/2w6mQfCb4eSWpHTUXKVdiN42q26NdH/I43U OfldQKIXbBFf+cU/YxXDE/mDnKvz05o15gpsqIEq2EP4PZsZarPGhVMHFv8BheK5jTz2 AWSx2IdBgb0x4xi3Sa6s3PCGoRf1hLQLVrvJ4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=ouNQju2bi/NI38c+8E3nGORPwefdly7WiqtRhIqdhYSrkb8j8wh1XpfGA+lxtLtGHH B8/f8oWgpiU5RMWWsQLvauAD3N5FPTKCgSOYcO6xpezXoh+s7QlzBY6/z0rWz1/hW2Y2 rIjPMjRzFZJSvzIGpAZ2M8TqnF6/U42rHeJFI= MIME-Version: 1.0 Received: by 10.229.29.20 with SMTP id o20mr1856011qcc.181.1307141074052; Fri, 03 Jun 2011 15:44:34 -0700 (PDT) Received: by 10.229.184.213 with HTTP; Fri, 3 Jun 2011 15:44:34 -0700 (PDT) Received: by 10.229.184.213 with HTTP; Fri, 3 Jun 2011 15:44:34 -0700 (PDT) In-Reply-To: References: Date: Fri, 3 Jun 2011 23:44:34 +0100 Message-ID: Subject: Re: Patch to disable all Queues From: Gary Tully To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=0016364271d663e59104a4d67f96 X-Virus-Checked: Checked by ClamAV on apache.org --0016364271d663e59104a4d67f96 Content-Type: text/plain; charset=ISO-8859-1 Think so, it has low impact and gives you value, so go ahead. On 3 Jun 2011 20:22, "Jeremy Levy" wrote: > Is this useful enough for me to submit a JIRA ticket with the patch? > > On Wed, Jun 1, 2011 at 1:25 PM, Jeremy Levy wrote: > >> Gary- >> >> Right, exclusive consumer won't work as I still want to have multiple >> consumers. >> >> I don't have a requirement to start these consumers after the container is >> started, you would have to change the system property and redeploy your app >> or restart your container. >> >> I'm not that familiar with using properties via jmx/mbean, I followed a >> similar pattern using the system property that other tools like Ehcache and >> Terrcotta use for controlling some global functionality. >> >> Jeremy >> >> >> On Wed, Jun 1, 2011 at 10:38 AM, Gary Tully wrote: >> >>> interesting, I guess the "exclusive consumer" feature won't cut it as >>> you are limited to a single consumer. >>> >>> How do those consumers eventually get activated, is a restart of the >>> container without the property? >>> >>> Would it make sense to have the property settable via jmx, so an mbean >>> on the resource adapter? >>> >>> On 1 June 2011 14:51, Jeremy Levy wrote: >>> > We currently deploy our ActiveMQ enabled Message Driven Beans along with >>> our >>> > larger application inside of an EAR file. This ear file is then >>> deployed >>> > across multiple application servers. However we only wanted consumers >>> to be >>> > active on certain dedicated servers. I wasn't able to find a solution >>> > within ActiveMQ that allows us to globally turn off consumers at >>> deployment. >>> > For a while we were tweaking the consumers via JMX but that was >>> problematic >>> > and could only be done after the consumer was activated and started >>> > processing. >>> > I built our own activemq-rar-5.4.2.rar with the following modifications: >>> > In ActiveMQResourceAdapter.java, public void >>> > endpointActivation(MessageEndpointFactory endpointFactory, >>> ActivationSpec >>> > activationSpec) >>> > Before creating the worker and checking to see if it previously >>> activated a >>> > quick system property check: >>> > >>> > if (!Boolean.valueOf(System.getProperty("activemq.endpoints.disabled", >>> > "false"))) {... >>> > >>> > If true, dont' actually enable any queues etc. I'm not sure this is the >>> > best method but it seems to be working. I've included a patch for the >>> 5.4.2 >>> > branch. I can prepare one for the trunk if the developers think this >>> would >>> > be a worthwhile contribution. >>> > Jeremy >>> > -- >>> > Jeremy Levy >>> > >>> >>> >>> >>> -- >>> http://fusesource.com >>> http://blog.garytully.com >>> >> >> >> >> -- >> Jeremy Levy >> > > > > -- > Jeremy Levy --0016364271d663e59104a4d67f96--