Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道在发生某些环境问题时如何停止/启动消息侦听器(例如,由 webservice 调用的远程服务器已关闭)。
在这种情况下,消息侦听器在尝试连接 Web 服务时继续尝试读取消息并获取异常。它将不中断地回滚队列重试。
如何停止或减慢消息侦听器。我使用 JBoss EAP 6。
非常感谢。
在我的情况下,似乎睡眠线程一段时间是最好的解决方案。
据我通过谷歌搜索发现,不推荐使用简单的 thread.sleep(mill),建议使用 @Asynchronous 和 Future。