Skip to content

Instantly share code, notes, and snippets.

@DarcInc
Last active August 29, 2015 13:57
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DarcInc/9641582 to your computer and use it in GitHub Desktop.
Save DarcInc/9641582 to your computer and use it in GitHub Desktop.
Node AMQ Message Consumer
var queueName = 'tasks';
var amq = require('amq');
var connection = amq.createConnection(
{ host: 'localhost', debug: true },
{ reconnect: { strategy: 'constant', initial: 1000 } }
);
var queue = connection.queue(queueName, { durable: true });
queue.consume(function(message) {
console.log(message.content.toString());
queue.ack(message);
}).then(null, console.warn);
@DarcInc
Copy link
Author

DarcInc commented Mar 19, 2014

Oopsie. Had a little bug in rev 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment