Closed felixhuettner closed 1 year ago
I'm not quite following - you want publish confirmations but you don't want to handle them?
We handle them now using PublishWithDeferredConfirmWithContext
and then calling WaitContext
on the confirmation
I think the cases where you'd want to set confirm mode, but don't want a handler to deal with those confirmations should be rare... I'm curious, why not just handle the confirmations as they come back across the channel?
We are publishing the rabbitmq messages during a database transaction. And we only want to commit the transaction once we are completely certain that the message has been published.
Therefor we use PublishWithDeferredConfirmWithContext
and then block until the confirmation is received.
And this is a lot simpler with WaitContext
than by using a custom handler
Ah! I see. Yeah if you guys want to open a PR for a publishing option that simply sets confirm mode I'm open to it. Under the hood I think it should just set the handler to an empty handler.
Hi everyone,
we where trying to use a
Publisher
with publish confirmations. For this to work the channel needs to be set to confirm mode.From the publisher this is only available using
startPublishHandler
which is implicitly called inNotifyPublish
.We are therefor using
publisher.NotifyPublish(func(_ rabbitmq.Confirmation) {})
to put the channel to confirm mode.Would it be possible to add this setting as a publisher option?