Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to publish with confirms #40

Closed
ofttryaj opened this issue Sep 22, 2021 · 4 comments · Fixed by #54
Closed

How to publish with confirms #40

ofttryaj opened this issue Sep 22, 2021 · 4 comments · Fixed by #54

Comments

@ofttryaj
Copy link

confirms := make(chan amqp.Confirmation)
ch.NotifyPublish(confirms)
go func() {
    for confirm := range confirms {
	    if confirm.Ack {
		    // code when messages is confirmed
		    log.Printf("Confirmed")
	    } else {
		    // code when messages is nack-ed
		    log.Printf("Nacked")
	    }
    }
}()
@pete-woods
Copy link

This feels like the only significant missing feature for me, from this library.

@wagslane
Copy link
Owner

wagslane commented Oct 1, 2021

It's a good point, I've been biased by my personal use-cases for rabbit a little bit here, I'm totally open to PRs though to add the feature!

@pete-woods
Copy link

For what it's worth (probably not what you want to hear), I ended up using this library, which does offer publisher confirms: https://github.com/makasim/amqpextra

@wagslane
Copy link
Owner

wagslane commented Dec 7, 2021

Good feedback, I'm merging this feature today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants