简体   繁体   English

JMS主题订户重新连接

[英]JMS topic subscriber reconnection

I'm using Glassfish 3.1.2.2 with OpemMQ 4.5.2 (remote mode). 我正在使用带有OpemMQ 4.5.2(远程模式)的Glassfish 3.1.2.2。 In my application, there is a subscriber of a JMS topic, that receives messages asynchronously, using a MessageListener . 在我的应用程序中,有一个JMS主题的订阅者,该订阅者使用MessageListener异步接收消息。

When broker is stopped and started after a while, messages published to the JMS topic after restart are not received by the subscriber. 当代理停止并在一段时间后启动时,订阅服务器不会接收到重新启动后发布到JMS主题的消息。

What is the best way to recover the topic subscriber? 恢复主题订户的最佳方法是什么?

I've tried ExceptionListener , but apparently it's not supported when running my application on Glassfish. 我尝试了ExceptionListener ,但是显然在Glassfish上运行我的应用程序时不支持它。

将“重新连接尝试”选项从“ Java消息服务”更改为“ -1”,Glassfish成功重新连接了发布者和订阅者。

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

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