Pause MDB message Processing

血红的双手。 提交于 2019-12-07 13:16:27

I doubt you can stop an MDB without stopping the whole application. It is possible with Spring JMS, but not with regular message driven beans.

What you could do, and is apparently possible, is pausing a queue. HornetMQ does give you the possibility to switch the queue to "receive only mode", though I don't know if this is available via the admin console.

In JBoss (4.x and 5.x), you can look up the MDB through the JMX Console and pause delivery of messages.

  1. Go to the jmx console (http://yourserver:8080/jmx-console/ where 8080 is the HTTP port)
  2. Click jboss.j2ee in the left-hand pane
  3. In the right-hand pane, find and click on your MDB. Usually, it will look something like

    jar=file-containing-your-MDB.jar,name=NameOfYourMDB,service=EJB3

  4. To pause, click the "Invoke" button next to "stopDelivery"
  5. To resume, click the "Invoke" button next to "startDelivery"

You can stop the Queue on HornetQ. (I'm not sure about JBoss Messaging, but I'm pretty sure you do)

Look for the message pause and resume on the JMX Console

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!