From 456cd1f70d22161f51749f48737aa038e0b69f6a Mon Sep 17 00:00:00 2001 From: Hongcai Deng Date: Fri, 10 May 2019 20:54:06 +0800 Subject: [PATCH] fix: producer should format topic first (#81) --- lib/producer/mq_producer.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/producer/mq_producer.js b/lib/producer/mq_producer.js index b8c9558..4708414 100644 --- a/lib/producer/mq_producer.js +++ b/lib/producer/mq_producer.js @@ -187,13 +187,13 @@ class MQProducer extends ClientConfig { */ async send(msg) { await this.ready(); + msg.topic = this.formatTopic(msg.topic); const topicPublishInfo = await this.tryToFindTopicPublishInfo(msg.topic); if (!topicPublishInfo) { throw new Error(`no publish router data for topic: ${msg.topic}`); } - msg.topic = this.formatTopic(msg.topic); const maxTimeout = this.options.sendMsgTimeout + 1000; const timesTotal = 1 + this.options.retryTimesWhenSendFailed;