Ad

Friday, 2 April 2010

To Pause/Start the Queue programattically in weblogic(using JMSDestinationRuntimeMBean)

one can puase or start the queue deployed in weblogic by using the admin console.But sometimes we may require to do this programmatically.Weblogic provides the API JMSDestinationRuntimeMBean for doing this.


Destination queue = (Destination) context.lookup("queue JNDI name");
weblogic.management.runtime.JMSDestinationRuntimeMBean destBean = weblogic.jms.extensions.JMSRuntimeHelper.getJMSDestinationRuntimeMBean(
context, queue);
destBean.pauseConsumption();   //Will pause the queue
destBean.resumeConsumption();   //Will start the paused queue again

3 comments:

  1. can you send me the complete script to my mail ID samba331@gmail.com.

    ReplyDelete
  2. I`m getting the following exception:
    javax.jms.JMSException: Unknown foreign destination end.

    Are you putting some parameters into context variable?

    ReplyDelete
  3. Hi Please send me the whole script. Thanks in advance.

    jamwalpankaj@gmail.com

    ReplyDelete