Skip to content

Instantly share code, notes, and snippets.

@madbence
Created December 4, 2013 20:15
Show Gist options
  • Select an option

  • Save madbence/7794711 to your computer and use it in GitHub Desktop.

Select an option

Save madbence/7794711 to your computer and use it in GitHub Desktop.
var amqp = require('amqp');
var conn = amqp.createConnection();
conn.once('ready', function() {
console.log('conn ready');
conn.queue('queue', function(q) {
console.log('queue open');
q.subscribe(function(message) {
console.log(message);
whoops;
});
var ex = conn.exchange('ex');
ex.once('open', function() {
console.log('exchange open');
q.bind(ex, 'queue');
ex.publish('queue', 'message');
whoops;
});
whoops;
});
whoops;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment