From 96a1a2f3909d89c84a0f281625086a4f346783cf Mon Sep 17 00:00:00 2001 From: Bernd Niehues Date: Wed, 21 Feb 2018 10:36:44 +0100 Subject: [PATCH] [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. --- lib/abstract_ascoltatore.js | 2 +- lib/amqp_ascoltatore.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/abstract_ascoltatore.js b/lib/abstract_ascoltatore.js index 0b78491..74bc514 100644 --- a/lib/abstract_ascoltatore.js +++ b/lib/abstract_ascoltatore.js @@ -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); }; } diff --git a/lib/amqp_ascoltatore.js b/lib/amqp_ascoltatore.js index b278c62..97ceb69 100644 --- a/lib/amqp_ascoltatore.js +++ b/lib/amqp_ascoltatore.js @@ -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); };