From users-return-13775-apmail-tomee-users-archive=tomee.apache.org@tomee.apache.org Tue Oct 8 20:30:38 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 59DE210C65 for ; Tue, 8 Oct 2013 20:30:38 +0000 (UTC) Received: (qmail 1685 invoked by uid 500); 8 Oct 2013 20:30:37 -0000 Delivered-To: apmail-tomee-users-archive@tomee.apache.org Received: (qmail 1393 invoked by uid 500); 8 Oct 2013 20:30:34 -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 1385 invoked by uid 99); 8 Oct 2013 20:30:33 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 20:30:33 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of rmannibucau@gmail.com designates 209.85.223.174 as permitted sender) Received: from [209.85.223.174] (HELO mail-ie0-f174.google.com) (209.85.223.174) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Oct 2013 20:30:26 +0000 Received: by mail-ie0-f174.google.com with SMTP id u16so20772692iet.33 for ; Tue, 08 Oct 2013 13:30:05 -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=VmB3Nreev1+X+9g/Eo2xkdsliIKFuK/Vgaap98m14Hg=; b=MkWsoBv4Tmaev2lsQs9iBUF99LkrQxspyuABvby0px1Q2RsKm6lBurNek8mUi/U6WQ C/tj3rmwcfpecenHaDxrFKQhpzepF88izknPZkPn1MEXfh79Nw0O7bU5tuxc077w3OXw yp85+WBAgebbovuLTRc/o/6Nw4pLoj77gZJXm9o2ZuThq3U2fMT7l26+T2CnPA8avBW2 u1keMQE2PmAWjzxFn1N2eSdk00vvjlm0MUOTRHM9xKzW0bqrjA6Ly9hEncp3ssnLE8Zw Tai/Ij1wr+d2XI1yNb86HjGMSSdw5GqJ22ArUcqt8mcNQVBvCbJ+u6Tk2ttmkKTP9e6P B/EA== MIME-Version: 1.0 X-Received: by 10.50.45.73 with SMTP id k9mr23061664igm.38.1381264205444; Tue, 08 Oct 2013 13:30:05 -0700 (PDT) Received: by 10.64.252.66 with HTTP; Tue, 8 Oct 2013 13:30:05 -0700 (PDT) Received: by 10.64.252.66 with HTTP; Tue, 8 Oct 2013 13:30:05 -0700 (PDT) In-Reply-To: References: Date: Tue, 8 Oct 2013 22:30:05 +0200 Message-ID: Subject: Re: Disable/Enable MDB From: Romain Manni-Bucau To: users@tomee.apache.org Content-Type: multipart/alternative; boundary=089e010d9e724e8f4304e840a24c X-Virus-Checked: Checked by ClamAV on apache.org --089e010d9e724e8f4304e840a24c Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Systeminstance.get().getcomponent(containersystem.class).getbeancontext(ejb= name).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 >wrote: > > > Hi > > > > You can do it with our internals but it is risky for your app. Isnt it = a > > design issue? > > Le 8 oct. 2013 18:48, "Leonardo K. Shikida" a =E9cr= it > : > > > > > Hi > > > > > > Is there any way to disable/enable a MDB programmatically? > > > > > > Right now, it consumes from a JMS queue and the queue definitions are > > coded > > > using @ActivationConfigProperty. if I just set a flag in the database > and > > > let the MDB check it before executing the onMessage() message, I gues= s > > I'd > > > have to re-enqueue the message. Instead, I'd like to just "pause" and > > > "restart" my MDBs, not touching the queue. > > > > > > or example, for tomee/openjpa, is there something similar to this cod= e > > 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 queu= e > > > and then it sends to the MDB method. > > > > > > So I guess what I am really looking for is some activemq or tomee JMX > > > instruction (and how to call it from inside a webapp code) telling > > > tomee to pause/resume it's JMS consumer. > > > > > > > > > TIA > > > > > > Leo > > > > > > --089e010d9e724e8f4304e840a24c--