summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kafka/coordinator/consumer.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/kafka/coordinator/consumer.py b/kafka/coordinator/consumer.py
index 00b8b6b..71a93ec 100644
--- a/kafka/coordinator/consumer.py
+++ b/kafka/coordinator/consumer.py
@@ -140,8 +140,9 @@ class ConsumerCoordinator(BaseCoordinator):
if self._subscription.subscribed_pattern.match(topic):
topics.append(topic)
- self._subscription.change_subscription(topics)
- self._client.set_topics(self._subscription.group_subscription())
+ if set(topics) != self._subscription.subscription:
+ self._subscription.change_subscription(topics)
+ self._client.set_topics(self._subscription.group_subscription())
# check if there are any changes to the metadata which should trigger
# a rebalance