Skip to content

Instantly share code, notes, and snippets.

@WoZ
Created April 5, 2013 13:46
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 WoZ/5319372 to your computer and use it in GitHub Desktop.
Save WoZ/5319372 to your computer and use it in GitHub Desktop.
var amqp = require('amqp');
var exchangeName = 'nonpresent.exchange';
var connection = amqp.createConnection({host: 'localhost'});
connection.on('ready', function() {
connection.on('error', function(err) {
console.log('connection error:', err);
});
var exch = connection.exchange(exchangeName, {passive: true});
exch.on('error', function(err) {
console.log('exchange error:', err);
});
setTimeout(function() {
exch.on('close', function() {
console.log('closed');
});
exch.close();
}, 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment