From 02e5dd06b66855460c1bffbbbdfa442440c7d29e Mon Sep 17 00:00:00 2001 From: Bruno Sampaio Pinho da Silva Date: Mon, 2 Nov 2020 22:31:07 -0500 Subject: [PATCH] Add UNKNOWN_TOPIC_OR_PARTITION check for addMultipleTargetTopics addMultipleTargetTopics cluster method fails to restore 'targetTopics' when kafka has KAFKA_AUTO_CREATE_TOPICS_ENABLE set to false. --- src/cluster/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cluster/index.js b/src/cluster/index.js index 4cc56a215..c8acce6be 100644 --- a/src/cluster/index.js +++ b/src/cluster/index.js @@ -190,7 +190,7 @@ module.exports = class Cluster { try { await this.refreshMetadata() } catch (e) { - if (e.type === 'INVALID_TOPIC_EXCEPTION') { + if (e.type === 'INVALID_TOPIC_EXCEPTION' || e.type === 'UNKNOWN_TOPIC_OR_PARTITION') { this.targetTopics = previousTopics }