-
1. Re: Can a MDB be suspend & resume itself?
schrouf Jan 15, 2003 11:24 AM (in response to paulbandler)How should an MDB reactivate itself after self-deactivation ( which might be technically possible with some tedious MBean code )? There has to be some other external monitor/stimulus for that !
-
2. Re: Can a MDB be suspend & resume itself?
genman Jan 17, 2003 6:47 PM (in response to paulbandler)
Take a look at somebody's message here:
http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ the source to JBoss and craft yourself an Invoker subclass.
See the classes:
server/src/main/org/jboss/invocation/Invoker.java
server/src/main/org/jboss/invocation/Invocation.java
server/src/main/org/jboss/ejb/plugins/jms/JMSContainerInvoker.java
Invocation.getArguments() returns an array of one object,
the first is the javax.jms.Message going to your MDB.
You can decide to hold on to the message, or redirect it to another queue, like the dead letter service. Remember that you're going to be affecting all JMS messages.
Probably even better: If you want to suspend message delivery, you can easily call stopService on the MDB using the "jmx-console", and then startService to being receiving the messages again.
There are lots of ways of doing this.