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

Confusing NotifyPublish() documentation #396

Closed taybin closed 5 years ago

taybin commented 5 years ago

Acknowledgments will be received in the order of delivery from the NotifyPublish channels even if the server acknowledges them out of order.

If the server acknowledges them out of order, does this mean the NotifyPublish channel won't do anything until the expected confirmations have come in? Say we have published messages [1, 2, 3], and the server acks 2, and then 1. Does this mean that the NotifyPublish channel won't write anything about 2 until the server acks 1, and then it will send the acks in the order 1, 2 over the channel?

My concern is that 2 could be ack'd, but then the server or client crashes and the ack for 1 isn't delivered, and then the client will have to resend message 2, even though it was successfully ack'd by the server.

streadway commented 5 years ago

That's correct and can also happen while the ack for msg 2 is in-flight (sent by the server but not yet received by the client).

taybin commented 5 years ago

Okay, thank you.