如果我使用发布者确认,我可以(合理地)确定发送到RabbitMQ服务器上的exchange的消息以及从RabbitMQ服务器接收确认的消息不会丢失,即使RabbitMQ服务器崩溃(例如断电)。
但是,当消息在使用者手动拒绝后到达死信交换时会发生什么?(channel.basicReject,我使用Spring AMQP。)
如果原始消息从使用者正在侦听的队列中退出队列,并且RabbitMQ服务器随后崩溃,我是否仍然可以确定,在RabbitMQ服务器重新启动后,我最终会在绑定到死信交换的队列中找到该消息(如果正常情况下该消息已经到达该队列)?
如果答案是否定的,有没有办法确保情况是这样的?
发布于 2019-06-26 05:36:31
正如@GaryRussell建议的那样,我在rabbitmq-users Google group上发布了一个类似的问题。
以下是我从Daniil Fedotov那里得到的答案
"Hi,
There is no delivery guarantees in place. Dead lettering does not check if the message was enqueued or saved to disk.
Dead-lettering does not use publisher confirms or any other confirm mechanisms.
It's not that easy to implement reliable dead-lettering from one queue to another and there are plans to address this issue eventually, but it may take a while.
If you want to safely reject messages from the consumer without a risk of losing them - you can publish them from the consumer application manually to the dead-letter queue, wait for the confirmation and then reject."https://stackoverflow.com/questions/56750827
复制相似问题