当将重试的数量更改为有限时

发布于 2025-02-08 09:17:59 字数 845 浏览 1 评论 0原文

JMS入口网关用于工人侧的请求处理。 CustommessageListenerContainer类配置为将最大尝试重新限制。 在某些情况下,当Active MQ服务器在最大尝试限制到达容器之前未响应时,请停止使用以下消息。 “为目标'senextractworkeringway'停止容器':向后策略不允许进一步尝试。”

想知道一旦活动MQ可用,是否有任何配置可恢复这些容器。 示例配置在下面给出。

<int-jms:inbound-gateway
    id="senExtractWorkerInGateway" 
    container-class="com.test.batch.worker.CustomMessageListenerContainer"
    connection-factory="jmsConnectionFactory"
    correlation-key="JMSCorrelationID"
    request-channel="senExtractProcessingWorkerRequestChannel"
    request-destination-name="senExtractRequestQueue" 
    reply-channel="senExtractProcessingWorkerReplyChannel"
    default-reply-queue-name="senExtractReplyQueue"
    auto-startup="false"
    concurrent-consumers="25"
    max-concurrent-consumers="25"
    reply-timeout="1200000" 
    receive-timeout="1200000"/>

JMS Inbound gateway is used for request processing at worker side. CustomMessageListenerContainer class is configured to impose back off max attempts as limited.
In some scenarios when active MQ server is not responding before max attempts limit reached container is being stopped with below message.
"Stopping container for destination 'senExtractWorkerInGateway': back-off policy does not allow for further attempts."

Wondering is there any configuration available to recover these containers once the Active MQ is back available.
sample configuration is given below.

<int-jms:inbound-gateway
    id="senExtractWorkerInGateway" 
    container-class="com.test.batch.worker.CustomMessageListenerContainer"
    connection-factory="jmsConnectionFactory"
    correlation-key="JMSCorrelationID"
    request-channel="senExtractProcessingWorkerRequestChannel"
    request-destination-name="senExtractRequestQueue" 
    reply-channel="senExtractProcessingWorkerReplyChannel"
    default-reply-queue-name="senExtractReplyQueue"
    auto-startup="false"
    concurrent-consumers="25"
    max-concurrent-consumers="25"
    reply-timeout="1200000" 
    receive-timeout="1200000"/>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

月亮邮递员 2025-02-15 09:17:59

您可能可以从applabackofftime() cust> cust custMomtesgeAgeListEnerContainer 发出一些applicationEvent false 。这样,您就会知道ActiveMQ连接有问题。此刻,您还需要stop()您的senextractworkeringway - 只需将其自动为某些控制服务,以lifecycle。解决连接问题时,您只需要启动此senextractworkeringateway返回即可。该CustMomtessageListenerContainer将自动启动。

You probably can emit some ApplicationEvent from the applyBackOffTime() of your CustomMessageListenerContainer when the super call returns false. This way you would know that something is wrong with ActiveMQ connection. At this moment you also need to stop() your senExtractWorkerInGateway - just autowire it into some controlling service as a Lifecycle. When you done fixing the connection problem, you just need to start this senExtractWorkerInGateway back. That CustomMessageListenerContainer is going to be started automatically.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文