Open tcort opened 9 years ago
the same problem, I wish to be notified if I pubilish a message when connection is broken. Instead, connection.on('error') seems to catch the problem, but, how could I know which message is not sent. Or, can publish task restarted after connection reestablished?
Same issue. Looking forward to having it fixed. I would expect that if connection is closed (as close event notifies), publish method's callback is called with err set to true. Or at least, being able to check connection status.
This is solved on https://github.com/dropbox/amqp-coffee which is based off node-amqp but has a slightly different api
+1
And me too! Somebody, are you here? We all need help about this issue :)
@tcort in your case, you should pass "confirm" option while declaring exchange https://github.com/postwait/node-amqp#exchange so, somthing like this:
connection.exchange( '< someName> ', { autoDelete:false, ... , confirm:true }, function onExchange(){...} );
I think, it should hуlp:)
+1
I have some code that looks something like this. It publishes 1 message per second. It waits until the prior message has been published before publishing a new message.
The exchange is durable, non-autoDelete, topic type with confirm turned on. When I run the above code and I send while the connection is down, I never get a callback.
I am expecting the callback to be called when the connection is reestablished and the message is sent -- either that or I would expect a publication error (because the connection is down). Instead, there is no callback. With the debugging output turned on, I see that it does a basicPublish and gets a basicAck after the reconnect, but the callback isn't called.
Environments: