From users-return-13776-apmail-tomee-users-archive=tomee.apache.org@tomee.apache.org Tue Oct 8 20:55:30 2013 Return-Path: X-Original-To: apmail-tomee-users-archive@www.apache.org Delivered-To: apmail-tomee-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 52ECB10DAA for ; Tue, 8 Oct 2013 20:55:30 +0000 (UTC) Received: (qmail 62868 invoked by uid 500); 8 Oct 2013 20:55:29 -0000 Delivered-To: apmail-tomee-users-archive@tomee.apache.org Received: (qmail 62659 invoked by uid 500); 8 Oct 2013 20:55:27 -0000 Mailing-List: contact users-help@tomee.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@tomee.apache.org Delivered-To: mailing list users@tomee.apache.org Received: (qmail 62645 invoked by uid 99); 8 Oct 2013 20:55:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 20:55:26 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_REPLY,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of shikida@gmail.com designates 209.85.217.171 as permitted sender) Received: from [209.85.217.171] (HELO mail-lb0-f171.google.com) (209.85.217.171) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 20:55:19 +0000 Received: by mail-lb0-f171.google.com with SMTP id u14so3997lbd.30 for ; Tue, 08 Oct 2013 13:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=GRWUpnfgiXo1UkLyATJ4KUNN/HgxGVagKlFLb04JHRI=; b=WAaPsb8vUMYnaLQVm9MddX1gOkKQRAvRtivI0dIg7q3EJmDiHli17Knj6iPD0qnAPT xX/gZ6xjTsNPWHrxfzVdKjD5tSToB7A/uZev9OFOovsL0VhdIC7ZN1SN/tWLemy8yl8b nVC0YSVBh+CjJVJo9vguBPczO10SE1q6IHHAZ/1EPdnBZV2qxumBlscTNLwAaFcUIfxQ n6tFPKjbvd9GlbZ8eiYa1ynQvxLqkTz5gFx3xQH1dm0BeqCWxQc3TYVQZwk6S920D9Ui qDMAkSIYJwLcpNjc7J1NQip4mbieVMchN/LTjY1aRxzvfz7KH9+hCMUXoeNLWCeZZsnj PX1A== MIME-Version: 1.0 X-Received: by 10.152.115.242 with SMTP id jr18mr2953885lab.40.1381265697860; Tue, 08 Oct 2013 13:54:57 -0700 (PDT) Received: by 10.112.218.97 with HTTP; Tue, 8 Oct 2013 13:54:57 -0700 (PDT) Received: by 10.112.218.97 with HTTP; Tue, 8 Oct 2013 13:54:57 -0700 (PDT) In-Reply-To: References: Date: Tue, 8 Oct 2013 17:54:57 -0300 Message-ID: Subject: Re: Disable/Enable MDB From: "Leonardo K. Shikida" To: users@tomee.apache.org Content-Type: multipart/alternative; boundary=001a11c3327a42f09f04e840fb41 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c3327a42f09f04e840fb41 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thx Em 08/10/2013 17:30, "Romain Manni-Bucau" escreveu: > > Systeminstance.get().getcomponent(containersystem.class).getbeancontext(e= jbname).getcontainer() > i think > Le 8 oct. 2013 20:19, "Leonardo K. Shikida" a =E9crit= : > > > Hi Romain > > > > where should I look first in the internals? :-) > > > > TIA > > > > Leo > > > > > > > > > > [] > > > > Leo > > > > > > On Tue, Oct 8, 2013 at 2:15 PM, Romain Manni-Bucau < > rmannibucau@gmail.com > > >wrote: > > > > > Hi > > > > > > You can do it with our internals but it is risky for your app. Isnt i= t > a > > > design issue? > > > Le 8 oct. 2013 18:48, "Leonardo K. Shikida" a > =E9crit > > : > > > > > > > Hi > > > > > > > > Is there any way to disable/enable a MDB programmatically? > > > > > > > > Right now, it consumes from a JMS queue and the queue definitions a= re > > > coded > > > > using @ActivationConfigProperty. if I just set a flag in the databa= se > > and > > > > let the MDB check it before executing the onMessage() message, I > guess > > > I'd > > > > have to re-enqueue the message. Instead, I'd like to just "pause" a= nd > > > > "restart" my MDBs, not touching the queue. > > > > > > > > or example, for tomee/openjpa, is there something similar to this > code > > > for > > > > jboss? > > > > > > > > MBeanServer mbeanServer =3D MBeanServerLocator.locateJBoss(); > > > > ObjectName objName =3D new > > > > > > > > > > > > > > ObjectName("jboss.j2ee:ear=3DMessageGateway.ear,jar=3DMessageGateway-EJB.= jar,name=3DMessageSenderMDB,service=3DEJB3"); > > > > JMSContainerInvokerMBean invoker =3D (JMSContainerInvokerMBean) > > > > MBeanProxy.get(JMSContainerInvokerMBean.class, objName, mbeanServer= ); > > > > > > > > invoker.stop(); //Stop MDB > > > > invoker.start(); //Start MDB > > > > > > > > If I'd understood this well, the container consumes from the JMS > queue > > > > and then it sends to the MDB method. > > > > > > > > So I guess what I am really looking for is some activemq or tomee J= MX > > > > instruction (and how to call it from inside a webapp code) telling > > > > tomee to pause/resume it's JMS consumer. > > > > > > > > > > > > TIA > > > > > > > > Leo > > > > > > > > > > --001a11c3327a42f09f04e840fb41--