alanxz/SimpleAmqpClient

Prefetch of Quorum queues

voyage34 opened this issue · 2 comments

Quorum queues do not support global QoS prefetch (as specified here), whereas as I understand SimpleAmqpClient always invokes QoS with global=true.

Indeed, when BasicConsume is called with default message_prefetch_count, I get an exception. However, when it is called with message_prefetch_count=0, it returns fine, and (what's more surprising) I can even later do seemingly successful BasicQos calls...

Can I rely on this behavior or/and is there a more proper way of dealing with QoS on Quorum queues?

(v.2.6.0, according to Version.h.)

I'm facing the same issue. SimpleAmqpClient BasicConsume does not work with message_prefetch_count>0 when used with quorum queues. Exception on the RabbitMQ broker says: "operation basic.consume caused a connection exception not_implemented: "queue ..... in vhost '/' does not support global qos"
Also, it's true that if message_prefetch_count=0 is used with BasicConsume, subsequent BasicQos calls do not fail, however those calls do not have any effect on the broker.

Any hints/info about this issue?

The issue is here:

qos.global = m_impl->BrokerHasNewQosBehavior();

This always sets basic.qos.global to true when connected to newer RabbitMQ brokers.

A simple solution (and a more flexible API) would be to have a way to explicitly set this value when using BasicConsume
A quick ad-hoc solution, which works ok:
patch.txt