RabbitMQ"什么是“准备好"?和“未确认"消息类型? [英] RabbitMQ" What are "Ready" and "Unacked" types of messages?

查看:22
本文介绍了RabbitMQ"什么是“准备好"?和“未确认"消息类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 RabbitMQ 中的这两种类型的消息感到困惑.

I'm getting confused between these two types of messages in RabbitMQ.

我发现我的一些队列有 0 条Unacked"和 1000 条Ready"消息,而有些队列有 1000 条Unacked"和 0 条Ready"消息.

I've seen that some of my queues have 0 "Unacked" and 1000 "Ready" messages, while some have 1000 "Unacked" and 0 "Ready" messages.

它们有什么区别?

我如何知道消费者阅读了多少条消息?

And how can I know how many of the messages are read by the consumer(s)?

推荐答案

消息在等待处理时就绪.

当消费者连接到队列时,它会获得一批要处理的消息.数量在预取大小中给出.当该消费者处理消息时,他们的状态为未确认.

When a consumer connects to the queue it gets a batch of messages to process. The amount is given in the prefetch size. While this consumer is working on the messages they get the status unacked.

Unacked 表示消费者已承诺处理它们,但尚未确认它们已被处理.当消费者崩溃时,队列知道消费者上线时要再次传递哪些消息.当您有多个消费者时,消息会在它们之间分发.

Unacked means that the consumer has promised to process them but has not acknowledged that they are processed. When the consumer crashed the queue knows which messages are to be delivered again when the consumer comes online. When you have multiple consumers the messages are distributed among them.

这篇关于RabbitMQ"什么是“准备好"?和“未确认"消息类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆