I am writing a Node.js application that relies on RabbitMQ. I'm using node-amqp as the library of choice to connect to RabbitMQ.
Once I have established a connection to RabbitMQ, first thing I am going to do is to create an exchange:
var options = { autoDelete: false, confirm: true, durable: true, type: 'direct' };
connection.exchange('myExchange', options, function (myExchange) {
// ...
});
This works perfectly. As you can see, I am creating the exchange using confirm: true
, hence I expect the exchange to be in confirm mode afterwards.
Now a problem appears once I try to publish a message:
var options = {};
myExchange.publish('', { data: 'foobar' }, options, function () {
// ...
});
The problem is that the callback of the publish
function is never called - although the message was successfully published (as I can see within RabbitMQ's web management tool).
Did I understand confirm mode in a wrong way? Is this a bug with node-amqp?
Any help would be appreciated :-)