diff --git a/lib/sockets.js b/lib/sockets.js index b793962..449f4ee 100644 --- a/lib/sockets.js +++ b/lib/sockets.js @@ -415,7 +415,7 @@ ReqSocket.prototype.handleReply = function(msg) { ReqSocket.prototype.connect = function(destination, callback) { var self = this, ch = this.ch; - ch.assertQueue(destination, {durable: this.options.persistent}) + ch.assertQueue(destination, {durable: this.options.persistent, autoDelete: this.options.autoDelete || false}) .then(function(ok) { self.queues.push(ok.queue); }).then(callback); @@ -458,7 +458,7 @@ RepSocket.prototype.connect = function(source, callback) { delay(callback); return; } - ch.assertQueue(source, {durable: this.options.persistent}) + ch.assertQueue(source, {durable: this.options.persistent, autoDelete: this.options.autoDelete || false}) .then(function(ok) { return ch.consume(source, function(msg) { if (msg !== null) {