关于rabbitmq的确认模式的问题

问题描述 投票:0回答:1
I know consumer Delivery Acknowledgements divided by manual or automatic modes. But in my opinion,the concept of Delivery Acknowledgements is the same is manual modes. Automatic modes is deleted immediately after it is sent, where have a relationship with ack? I find official docs [enter image description here](https://i.stack.imgur.com/yUWIk.png) I think automatic modes is when consumer reveived a message, it doesn't handle flowing steps , it do ack to rabbitmq,let it delete the message from queue. 

希望得到详细答复

java rabbitmq
1个回答
0
投票

消费者Delivery Acknowledgment手动模式和自动模式的区别在于消费者收到消息后会向RabbitMQ发送ack消息,RabbitMQ会从Queue中删除该消息。
事实上,你的消费者消费一条消息需要一些时间,消费时间的长短取决于你的代码运行时间。
假设您的消费者将 ack 发送到您的 Rabbitmq,您的系统将丢失该消息。
但是如果你手动确认 RabbitMQ,你的 RabbitMQ 会知道你的消费者遇到了一些问题,它会将消息传递给其他消费者。
另一方面,如果您的消费者未能消费消息,您可以简单地向 RabbitMQ 发送 no ack 以确保您的消息能够正确消费。

© www.soinside.com 2019 - 2024. All rights reserved.