Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

[BUGFIX] Forward amqp options when publish to exchange #183

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
[BUGFIX] Forward amqp options when publish to exchange
When publishing a message to rabbitmq via amqp the options object was
dropped in amqp_ascolatore. The options object is now forwarded to
the exchange.
  • Loading branch information
Bernd Niehues authored and Bernd Niehues committed Feb 21, 2018
commit 96a1a2f3909d89c84a0f281625086a4f346783cf
2 changes: 1 addition & 1 deletion lib/abstract_ascoltatore.js
Original file line number Diff line number Diff line change
@@ -128,7 +128,7 @@ AbstractAscoltatore.prototype._setPublish = function() {
publish = this.publish;
} else {
publish = function (topic, payload, options, done) {
return f.call(this, topic, payload, done);
return f.call(this, topic, payload, options, done);
};
}

4 changes: 2 additions & 2 deletions lib/amqp_ascoltatore.js
Original file line number Diff line number Diff line change
@@ -149,12 +149,12 @@ AMQPAscoltatore.prototype.subscribe = function subscribe(topic, callback, done)
debug("registered new subscriber for topic " + topic);
};

AMQPAscoltatore.prototype.publish = function publish(topic, message, done) {
AMQPAscoltatore.prototype.publish = function publish(topic, message, options, done) {
this._raiseIfClosed();

debug("new message published to " + topic);

this._exchange.publish(this._pubTopic(topic), String(message));
this._exchange.publish(this._pubTopic(topic), String(message), options);
defer(done);
};