Last active
August 29, 2015 13:57
Node AMQ Message Consumer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Oopsie. Had a little bug in rev 1.