首页 > 解决方案 > 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?

标签: jmslistenerhybris

解决方案


您可以借助DMLC (DefaultMessageListenerContainer),它允许停止/重新启动以及对其配置进行运行时更改。您需要做的就是将其 bean 注入您的 cronJob 并根据您的输入执行停止/启动方法。

PS:我没试过,你可以试试!!


推荐阅读