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.
我有 5 个并发消费者。如何停止侦听队列但让我的消费者完成任务(而不是在业务逻辑中间将消息重新发布回队列)?
如果我在 SimpleMessageListenerContainer 中调用 stop()/shutdown() 方法,它会等待默认 5 秒并强制连接关闭,然后重新发布消息。
这是一个错误;容器应等待飞行消息完成但不开始处理新消息。这是固定的 - https://jira.springsource.org/browse/AMQP-338
原帖