jms - In Hybris,can we start and stop a IBM JMS listener via a cronjob
问题描述
We have a requirement where we need to stop a listener from polling message from a queue at the same time we need to start another listener to read messages from separate queue.
In short both listeners should not be active at the same time.
How can we achieve this?
Can we develop a cronjob which will start/stop the Listener from polling respective queues at scheduled times?
解决方案
您可以借助DMLC (DefaultMessageListenerContainer),它允许停止/重新启动以及对其配置进行运行时更改。您需要做的就是将其 bean 注入您的 cronJob 并根据您的输入执行停止/启动方法。
PS:我没试过,你可以试试!!
推荐阅读
- grails - Bazel 可以与 Grails 一起使用吗?
- c++ - 为 CDT 项目添加多个库到 Eclipse-IDE
- sql - SQL 中的正则表达式元字符在 Oracle 和 Postgres 中产生不同的结果
- javascript - discord.js - 将代码嵌入
- wordpress - 如何在元框中列出自定义类型的帖子?
- python-2.7 - 在 PySpark 中使用拆分功能
- r - 在ggplot中标记段的中点
- visual-studio - 如何从命令行限制 Visual Studio 构建的 cmake 配置类型?
- javascript - replace() 方法不替换
- java - 使用 End2endIT 测试连接到同一频道的两个组织。第二个在实例化链码时失败