Observation-Management-Service / MQClient

A Message Queue Client API Supporting Apache Pulsar, RabbitMQ, and NATS.io
MIT License
0 stars 1 forks source link

RabbitMQ Prefetch Redux #106

Closed ric-evans closed 1 year ago

ric-evans commented 1 year ago

Well, I got it wrong. According to RabbitMQ's definition of prefetch, a value of 0 means to drain the entire queue into the consumer--an infinite prefetch. This PR fixes that by setting a minimum value of 1

If you have many consumers and/or long processing time, we recommend you to set the prefetch count to one (1) so that messages are evenly distributed among all your workers.

https://www.cloudamqp.com/blog/part1-rabbitmq-best-practice.html#prefetch

ric-evans commented 1 year ago

done