Skip to content

Commit

Permalink
fix: producer should format topic first (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
denghongcai committed May 10, 2019
1 parent 38a9e9e commit 456cd1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/producer/mq_producer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 456cd1f

Please sign in to comment.