在 RabbitMQ 教程中,有这样的代码:
channel.BasicQos(prefetchSize: 0, prefetchCount: 1, global: false);
我明白什么是
prefetchCount
和 global
,但不是 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/