Closed rebbuh closed 4 years ago
http://www.inanzzz.com/index.php/post/0aeg/creating-a-rabbitmq-producer-example-with-golang
There is a "confirmation mode" section in post above. It addresses your issue. The "create.go" file uses it. Also read the whole post. It explains many things.
Thanks! The important part is to also subscribe to channel.NotifyClose, not only to connection.NotifyClose.
When a message is published to an exchange that does not exist, the Publish method does not return an error. Is there any way to handle this situation?
I know that I can use NotifyReturn to get a Return struct when the mandatory flag is set and there is no route for the given routing key, but obviously this does not apply to non-existing exchanges.
This somehow relates to issue #445, but it was closed by @BentCoder shortly after its creation without any comment.