in RabbitMQ"s go support library, there are two methods
func (ch * Channel) Ack (tag uint64, multiple bool) error
and func (d Delivery) Ack (multiple bool) error
but do not understand the difference between these two methods?
the description of the two methods is as follows:
Channel.Ack
Ack acknowledges a delivery by its delivery tag when having been consumed with Channel.Consume or Channel.Get.
Ack acknowledges all message received prior to the delivery tag when multiple is true.
See also Delivery.Ack
Delivery.Ack
Ack delegates an acknowledgement through the Acknowledger interface that the client or server has finished work on a delivery.
All deliveries in AMQP must be acknowledged. If you called Channel.Consume with autoAck true then the server will be automatically ack each message and this method should not be called. Otherwise, you must call Delivery.Ack after you have successfully processed this delivery.
When multiple is true, this delivery and all prior unacknowledged deliveries on the same channel will be acknowledged. This is useful for batch processing of deliveries.
An error will indicate that the acknowledge could not be delivered to the channel it was sent from.
Either Delivery.Ack, Delivery.Reject or Delivery.Nack must be called for every delivery that is not automatically acknowledged.