rabbitmq - RabbitMQ 中的 prefetchSize 是什么?

标签 rabbitmq

在 RabbitMQ 教程中,有这样的代码:

channel.BasicQos(prefetchSize: 0, prefetchCount: 1, global: false);

我明白什么是 prefetchCountglobal ,但不是 prefetchSize .

有人知道吗?

最佳答案

我在协议(protocol)引用 https://www.rabbitmq.com/amqp-0-9-1-reference.html 中找到了这个(强调我的):

long prefetch-size

The client can request that messages be sent in advance so that when the client finishes processing a message, the following message is already held locally, rather than needing to be sent down the channel. Prefetching gives a performance improvement. This field specifies the prefetch window size in octets. The server will send a message in advance if it is equal to or smaller in size than the available prefetch size (and also falls into other prefetch limits). May be set to zero, meaning "no specific limit", although other prefetch limits may still apply. The prefetch-size is ignored if the no-ack option is set.

The server MUST ignore this setting when the client is not processing any messages - i.e. the prefetch size does not limit the transfer of single messages to a client, only the sending in advance of more messages while the client still has one or more unacknowledged messages.

关于rabbitmq - RabbitMQ 中的 prefetchSize 是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59493540/

相关文章:

java - RabbitMQ 批量确认

Ruby:按字节长度限制 UTF-8 字符串

java - 如何在 spring-amqp 请求/回复消息中设置回复的内容类型?

rabbitmq - 有人可以解释花中的平均负载吗?

python - RabbitMQ 客户端性能

node.js - 我应该如何组合docker容器?

python - AMQP:确认和预取

RabbitMQ工具: rabbitmqctl vs rabbitmqadmin

Python RabbitMQ 连接由子进程继承

rabbitmq - 为什么 "await Publish<T>"挂起/未完成/未完成