当将重试的数量更改为有限时
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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能可以从
applabackofftime()
cust> cust custMomtesgeAgeListEnerContainer 发出一些applicationEvent
false 。这样,您就会知道ActiveMQ连接有问题。此刻,您还需要stop()
您的senextractworkeringway
- 只需将其自动为某些控制服务,以lifecycle
。解决连接问题时,您只需要启动此senextractworkeringateway
返回即可。该CustMomtessageListenerContainer
将自动启动。You probably can emit some
ApplicationEvent
from theapplyBackOffTime()
of yourCustomMessageListenerContainer
when thesuper
call returnsfalse
. This way you would know that something is wrong with ActiveMQ connection. At this moment you also need tostop()
yoursenExtractWorkerInGateway
- just autowire it into some controlling service as aLifecycle
. When you done fixing the connection problem, you just need to start thissenExtractWorkerInGateway
back. ThatCustomMessageListenerContainer
is going to be started automatically.