SimpleAmqpClient icon indicating copy to clipboard operation
SimpleAmqpClient copied to clipboard

Setting QoS/prefetch_count not working with rabbitmq 3.7.15

Open chen116 opened this issue 4 years ago • 1 comments

Hi, So I tried to set the prefetch_count for the new consumer to 1 with Channel::ptr_t channel = Channel::Create("localhost",5672,"cat","meow","/",131072); std::string consumer_tag= channel->BasicConsume("queue", "test", false,false,false,1);

and also tried with this

channel->BasicQos(consumer_tag,1)

but once the consumer started running, when I run rabbitmqctl list_consumers on the broker, the prefetch_count for the consumer is still 0. Is there a quick fix or something I am not aware of? thanks

chen116 avatar Apr 25 '20 16:04 chen116

SimpleAmqpClient sets the prefetch per-channel (not per-consumer). What is the pre-fetch for the channel that the consumer is running on?

Note that SimpleAmqpClient creates a single AMQP channel per consumer, so setting it per-channel is effectively the same as setting it per-consumer in this case (setting it per-channel allows the prefetch to be changed after the consumer is created).

alanxz avatar Jun 21 '20 23:06 alanxz