Search code examples
webspherejmxmessage-driven-bean

Stop MDB from receiving messages?


I need to programmatically stop a Message-driven bean from receiving messages from a JMS queue.

My environment is WebSphere Application Server v7.

I think it could be done by some MBean operation on an Activation Specification MBean, but I can't locate the activationSpec using WebSphere's adminclient API.

I've browsed the JMX tree using JConsole and also tried printing out every available MBean and searching for the name of the activationspec. It's nowhere to be found.

Is this the right approach and what am I missing?

Could the MDB be stopped in any other way?

Thanks!


Solution

  • You need to find the right J2CMessageEndpoint and deactivate it. Look here :

    Managing the message endpoint lifecycle using wsadmin scripting

    J2CMessageEndpoint MBean

    Although the first link talks about wsadmin scripting you can do anything from java code as well.