Skip to content
Discussion options

You must be logged in to vote

To safely handle pending publisher confirms during connection or channel recovery in RabbitMQ.Client 7.x, you should avoid sharing confirmation state across channel recycles. Because deliveryTag sequence numbers reset to 1 on a new channel session, lingering TaskCompletionSource instances must be faulted immediately when the underlying channel closes.

Here is the recommended pattern using the async IChannel lifecycle:

1. Fault Pending Confirms on Channel Shutdown

Attach a handler to IChannel.ChannelShutdownAsync so that any unexpected disconnection drains and faults all unconfirmed tasks with a explicit exception.

public class ConfirmedPublisher
{
    private readonly ConcurrentDictionary<u…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by alisasantos
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Ask and answer questions about GitHub features and usage Programming Help Discussions around programming languages, open source and software development Welcome 🎉 Used to greet and highlight first-time discussion participants. Welcome to the community! source:ui Discussions created via Community GitHub templates
2 participants