I can't seem to get a confirm back when I publish to the default exchange. I'm currently using the master branch of node-amqp suggested by this post.
Code:
var amqp = require('amqp');
var conn = amqp.createConnection({ host: 'localhost' });
conn.once('ready', function () {
conn.publish('test_queue', 'test message', { /* empty options */ }, function (a, b) {
console.log('Publish complete.');
});
});
I believe the default exchange is a direct exchange with an empty string (all other options are default). According to the exchange.publish method, if the confirm option is true, it will call the callback supplied. I tried to create the exchange myself, but no luck there either.
var amqp = require('amqp');
var conn = amqp.createConnection({ host: 'localhost' });
conn.once('ready', function () {
conn.exchange('', { confirm: true }, function (exchange) {
exchange.publish('test_queue', 'test message', { /* empty options */ }, function (a, b) {
console.log('Publish complete.');
});
});
});
I can confirm that I am successfully publishing the messages by using the the basic python receive script from the RabbitMQ website.
Does the default exchange emit an ack message within the publish method? Am I calling this incorrectly?