Pause MDB message Processing

我的未来我决定 提交于 2020-02-23 04:07:13

问题


Can we pause the MDB message processing for some time? For example: Jboss 1-deployed MDB for message processing. Jboss 2:-Bean for gathering user details. If the MDB from jboss 1 calls bean in jboss 2 for getting users details. If this is the case, when we restart the Jboss 2, we need to pause the MDB in jboss 1 till the jboss 2 is UP. Is there any option to pause MDB, so that we can avoid failure of message?


回答1:


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.




回答2:


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"



回答3:


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



来源:https://stackoverflow.com/questions/8385244/pause-mdb-message-processing

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