To control the number of unacknowledge messages a worker can handle, you can set the QoS prefetch count. If it’s 0 or QoS is not set at all, a worker can hog all unacknowledged messages, slowing down the consumption process if you have multiple workers. Set it to desired prefetch count. To begin with, you can set it to 1.
err = ch.Qos(
1, // prefetch count
0, // prefetch size
false, // global
)