tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leonardo K. Shikida" <>
Subject Disable/Enable MDB
Date Tue, 08 Oct 2013 16:47:25 GMT

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 guess 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 code for

MBeanServer mbeanServer = MBeanServerLocator.locateJBoss();
    ObjectName objName = new
    JMSContainerInvokerMBean invoker = (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 JMX
instruction (and how to call it from inside a webapp code) telling
tomee to pause/resume it's JMS consumer.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message