Skip to content

Instantly share code, notes, and snippets.

@datariot
Last active December 19, 2015 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save datariot/5976772 to your computer and use it in GitHub Desktop.
Save datariot/5976772 to your computer and use it in GitHub Desktop.
Having a problem where running on the server in Meteor, only the first callback parameter is received. Running at Node console correctly returns all the parameters for the callback. I've left out some code that ensures the RabbitMQ server is ready for brevity.
AMQP = Npm.require("amqp");
rabbitMQ = AMQP.createConnection({ host: '127.0.0.1' });
rabbitMQ.queue('foo', {durable:true, autoDelete:false}, function (queue, messages, consumers) {
console.log('Queue ' + queue.name + ' is open with ' + messages + ' messages');
});
/* Queue foo is open with undefined messages */
AMQP = require("amqp");
rabbitMQ = AMQP.createConnection({ host: '127.0.0.1' });
rabbitMQ.queue('foo', {durable:true, autoDelete:false}, function (queue, messages, consumers) {
console.log('Queue ' + queue.name + ' is open with ' + messages + ' messages');
});
/* Queue foo is open with 3 messages */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment