How to stop consuming messages with @RabbitListener

后端 未结 1 917
长情又很酷
长情又很酷 2020-12-15 01:38

When I use MessageListenerAdapter to handle message, I could call SimpleMessageListenerContainer.stop() to stop consume from the queue. But after I change to use @RabbitList

相关标签:
1条回答
  • 2020-12-15 02:36
    1. Give the @RabbitListener an id.
    2. Get a reference to the listener endpoint registry bean by autowiring etc.
    3. Calling stop() on the registry will stop all containers.
    4. Call getListenerContainer(id).stop() to stop an individual container.
    0 讨论(0)
提交回复
热议问题