Closed Icarus9913 closed 2 years ago
I mean that I can not locate the exact msg by the confirmed.DeliveryTag. I wanna try to re-publish this msg if the confirmed.Ack is false.
@Icarus9913 you need to preserve an inflight messages by our own, example using map[uint64]amqp.Publishing.
As mentions above, you need to store your messages coupled with the delivery number. Once confirmed, remove it from the map, if it's not confirmed, re-publish it again (probably up to certain amount of attempts). You can manually calculate the delivery number, or use the mechanism in #478 that was merged but not released. However, the exact same commit was released in rabbitmq/amqp091-go
: https://github.com/rabbitmq/amqp091-go/releases/tag/v1.2.0
Sorry for asking this simple question. If I publish one msg and get the confirmations (confirmations.ack==false). In this situation, how can I re-publish this msg? Should I use channel.Nack()? And how can I imitate the return confirmation ack is false?