streadway / amqp

Go client for AMQP 0.9.1
http://godoc.org/github.com/streadway/amqp
BSD 2-Clause "Simplified" License
4.88k stars 621 forks source link

potential memory growth with slow consumers. #490

Closed thothothotho closed 3 years ago

thothothotho commented 3 years ago

About that: https://github.com/streadway/amqp/blob/e6b33f460591b0acb2f13b04ef9cf493720ffe17/consumers.go#L72

I suppose the buffering was added there to consume the server flow as fast as possible. But if the consumer is slow and autoAck is true, it means the memory can grow without limit. No more back pressure.

I'm a bit a noob with rabbit, maybe this is the classical usage for a driver. From the docs, I thought ack was more for data safety (which I don't care for my usage). I was still expecting some correct flow control with some backpressure, with autoAck == true. So I would have expected from the driver to stop reading the tcp stream / rabbit channel, when the consumer does not read the go channel.

What is the status on this ? If the current unlimited buffering is what you want, then that should be clearly documented.

Thanks for your help.