dev@glassfish.java.net

[gf-dev] Re: Starting and stopping MDBs

From: Will Hartung <willh_at_mirthcorp.com>
Date: Thu, 9 Apr 2015 09:41:39 -0700

On Thu, Apr 9, 2015 at 6:12 AM, Mark Pope <markpope_at_gmail.com> wrote:
> I would like to stop or temporarily pause an MDB without interrupting
> message delivery to its queue. My search has found no good Glassfish
> solution. JBoss supports SMO(stage managed object) and can start and stop
> MDBs through JMX. Other postings are hacks in the onMessage() method or
> isolating the MDB to a jar and using the admin console to disable the jar.
>
> Is this an unsupported feature or am I trying to do something not
> recommended in an integration design?

I don't think GF has a way of disabling an individual MDB. Isolating
it in a Jar is not necessarily a bad idea.

Take your current MDB, turn it in to a Session Bean with a Remote
Interface, then create a new MDB that simply forwards the call from
the queue.

This technique keeps the MDBs really light weight, all depends on what
kind of traffic you're moving through it. If you're not moving Java
Classes as serialized objects, the MDB is single class wrapped in a
small jar file with no dependencies. If you are moving serialized
objects, you would need to bundle those classes with each MDB. If
you're just moving XML or JSON or something like that, you don't
really need anything.

Then, you have wide array of controls to control the MDBs: Adming GUI,
asadmin command line, JMX, GF REST Admin. You get all of that "for
free" by creating these simple facades.


Regards,

Will Hartung
(willh_at_mirthcorp.com)

-- 
This message, and any documents attached hereto, may contain confidential 
or proprietary information intended only for the use of the addressee(s) 
named above or may contain information that is legally  privileged. If you 
are not the intended addressee, or the person responsible for delivering it 
to the intended addressee, you are hereby notified that reading, 
disseminating, distributing or copying this message is strictly prohibited. 
If you have received this message by mistake, please immediately notify us 
by replying to the message and delete the original message and any copies 
immediately thereafter.  Thank you for your cooperation.