Skip to content

Commit

Permalink
tmp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bugthesystem committed Jun 5, 2015
1 parent dcc5b4e commit b0cd9c7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,18 +89,18 @@ Emitter.prototype.emit = function () {

if (this._channel === null) {
var _that = this;
_connect(_that.url, function cb(err, ch) {
_connect(_that.url, function cb(err, ch) {
if (err) return console.error("[AMQP]", err.message);

_that._channel = ch;
_that._channel.assertQueue(_that.key);
//_that._channel.sendToQueue(_that.key, data);
_that._channel.publish("fanout", _that.key, data);
_that._channel.sendToQueue(_that.key, data);
//_that._channel.publish("fanout", _that.key, data);
});

} else {
//this._channel.sendToQueue(this.key, data);
this._channel.publish("fanout", _that.key, data);
this._channel.sendToQueue(this.key, data);
//this._channel.publish("fanout", _that.key, data);
}

// reset state
Expand Down Expand Up @@ -130,7 +130,7 @@ function _connect(url, cb) {
console.error("[AMQP] create channel error", err.message);
return cb(err);
}

cb(null, ch);
});
});
Expand Down

0 comments on commit b0cd9c7

Please sign in to comment.