简体   繁体   English

如何防止Java MDB暂停IBM Websphere WAS 8.5上的错误?

[英]How to prevent Java MDB from pausing on errors on IBM Websphere WAS 8.5?

After throwing an exception, the MQ message endpoint of our Java MDB application is being paused with the message 抛出异常后,我们的Java MDB应用程序的MQ消息端点正在暂停消息

CWWMQ0007W: The message endpoint <APP> has been paused by the system.  Message delivery failed to the endpoint more than <N> times.

I understand that this is per Application Specification and that this behavior is reasonable for many applications. 我理解这是根据应用程序规范,这种行为对于许多应用程序来说是合理的。

In our case, we would like the MQ message causing the exception to be consumed from the queue and the application remaining running, ie. 在我们的例子中,我们希望从队列中消耗导致异常的MQ消息,并且应用程序仍在运行,即。 processing the next messages. 处理下一条消息。

Is there any way to achieve this way other than by catching any Throwable in the MDB onMessage method? 除了在MDB onMessage方法中捕获任何Throwable之外,有没有办法实现这种方式?

Read this article How WebSphere Application Server V8.x handles poison messages , it has various scenarios described. 阅读本文WebSphere Application Server V8.x如何处理有害消息 ,它描述了各种场景。

If you want to just continue processing without stopping endpoint, then either uncheck the Stop endpoint if message delivery fails or set Number of sequential delivery failures before suspending endpoint to some higher value in the activation specification configuration. 如果要在不停止端点的情况下继续处理,则Stop endpoint if message delivery fails取消选中“ Stop endpoint if message delivery fails或者Number of sequential delivery failures before suspending endpoint到激活规范配置中的某个更高值Number of sequential delivery failures before suspending endpoint设置Number of sequential delivery failures before suspending endpoint You also have to configure Backout threshold (BOTHRESH) property in the WebSphere MQ. 您还必须在WebSphere MQ中配置Backout threshold (BOTHRESH)属性。

In this way exception message will be put to DEAD.LETTER.QUEUE by MQ and will allow you to process next messages. 这样,MQ将把异常消息放到DEAD.LETTER.QUEUE ,并允许您处理下DEAD.LETTER.QUEUE消息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM