在 Wildfly 9 中有没有办法只暂停某些 MDB
In Wildfly 9 is there a way to suspend only certain MDB
我可以从 cli 调用 :suspend 和 :resume,但是,这会暂停所有 bean(EJB、MDB) .有没有办法只暂停消息驱动的 Bean MDB?
在我的应用程序中,所有工作都是通过消息完成的。如果我可以暂停消息消费者,我可以确定系统的其余部分将继续工作,直到完成所有正在进行的工作。例如,如果 EJB 试图将消息放入队列,它将能够这样做。
您可以在 MDB 上使用以下 CLI 操作。有关详细信息,请参阅 https://docs.jboss.org/author/display/WFLY10/Message+Driven+Beans+Controlled+Delivery。虽然文档是针对 WildFly 10 的;它也适用于 WildFly 9.x
对于独立模式:
[standalone@localhost:9990 /] cd deployment=jboss-helloworld-mdb.war/subsystem=ejb3/message-driven-bean=HelloWorldMDB
[standalone@localhost:9990 message-driven-bean=HelloWorldMDB] :stop-delivery
{"outcome" => "success"}
[standalone@localhost:9990 message-driven-bean=HelloWorldMDB] :start-delivery
{"outcome" => "success"}
对于域模式:
停止投放
/host=master/server=default/deployment=helloworld.app.war/subsystem=ejb3/message-driven-bean=HelloWorldMDB:stop-delivery
开始投放:
/host=master/server=default/deployment=helloworld.app.war/subsystem=ejb3/message-driven-bean=HelloWorldMDB:start-delivery
如果 MDB 驻留在 EAR 文件内的 EJB jar 中:
/host=master/server=default/deployment=helloworld.app.ear/subdeployment=helloworld.core.impl.jar/subsystem=ejb3/message-driven-bean=HelloWorldMDB:start-delivery
我可以从 cli 调用 :suspend 和 :resume,但是,这会暂停所有 bean(EJB、MDB) .有没有办法只暂停消息驱动的 Bean MDB?
在我的应用程序中,所有工作都是通过消息完成的。如果我可以暂停消息消费者,我可以确定系统的其余部分将继续工作,直到完成所有正在进行的工作。例如,如果 EJB 试图将消息放入队列,它将能够这样做。
您可以在 MDB 上使用以下 CLI 操作。有关详细信息,请参阅 https://docs.jboss.org/author/display/WFLY10/Message+Driven+Beans+Controlled+Delivery。虽然文档是针对 WildFly 10 的;它也适用于 WildFly 9.x
对于独立模式:
[standalone@localhost:9990 /] cd deployment=jboss-helloworld-mdb.war/subsystem=ejb3/message-driven-bean=HelloWorldMDB
[standalone@localhost:9990 message-driven-bean=HelloWorldMDB] :stop-delivery
{"outcome" => "success"}
[standalone@localhost:9990 message-driven-bean=HelloWorldMDB] :start-delivery
{"outcome" => "success"}
对于域模式:
停止投放
/host=master/server=default/deployment=helloworld.app.war/subsystem=ejb3/message-driven-bean=HelloWorldMDB:stop-delivery
开始投放:
/host=master/server=default/deployment=helloworld.app.war/subsystem=ejb3/message-driven-bean=HelloWorldMDB:start-delivery
如果 MDB 驻留在 EAR 文件内的 EJB jar 中:
/host=master/server=default/deployment=helloworld.app.ear/subdeployment=helloworld.core.impl.jar/subsystem=ejb3/message-driven-bean=HelloWorldMDB:start-delivery