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

Remove prefetch_size argument as not implemented? #438

Open KantarBruceAdams opened 4 years ago

KantarBruceAdams commented 4 years ago

I was experimenting with the Channel.Qos function and discovered that the only legal value of prefetch_size is zero.

Any other value results in:

error: Exception (540) Reason: "NOT_IMPLEMENTED - prefetch_size!=0 (1)": failed to set QoS on open AMQP channel
fatal: unable to open AMQP channel, Exception (540) Reason: "NOT_IMPLEMENTED - prefetch_size!=0 (1)"

I may have misunderstood something but looking at the discussion on this ticket https://github.com/php-amqplib/php-amqplib/issues/97 prefetch limits are not implemented by rabbitmq. If this library is rabbitmq specific it might be better to remove the redundant argument entirely.

The godoc documentation is misleading as it suggests other values are legal:

"With a prefetch size greater than zero, the server will try to keep at least that many bytes of deliveries flushed to the network before receiving acknowledgments from the consumers. This option is ignored when consumers are started with noAck. "

The README.md only mentions rabbitmq but if this library is intended to work with other AMQP implementations then the option would make more sense.