amqp-ts
amqp-ts copied to clipboard
Publisher confirms
I've been reviewing your code with the idea of possibly using it in production, however it appears that there is an issue with sending a message, the Exchange.send function (and the underlying publish method) don't return promises, so there is no way for the user of the app to confirm that the message they think they sent actually got to the broker.
If I'm reading the code correctly, if the code looses connection to the broker it will try to reconnect and these "in flight" messages may get sent, but in the event of a long outage and a restart of the app these messages will just get lost. Since there is no promise for the sender to wait on, there is also no way of limiting the number of messages stuck waiting on getting published
I've found the same issue. If my server app loses the connection to rabbit I don't get any errors / warnings etc. Messages are lost with no notification at all.
Did anyone find a solution for this one? I am facing the same issue. Is there any alternative for this repo?
Use createConfirmChannel
instead of createChannel
in Queue._initialize
and Exchange._initialize
implementations