change_subscription called only when necessary (#1132)
When we are using subscription by pattern change subscription is called every metadata update even when nothing changes. This PR ensures that change subscription is called only when set of topics changes.
This commit is contained in:
@@ -140,6 +140,7 @@ class ConsumerCoordinator(BaseCoordinator):
|
||||
if self._subscription.subscribed_pattern.match(topic):
|
||||
topics.append(topic)
|
||||
|
||||
if set(topics) != self._subscription.subscription:
|
||||
self._subscription.change_subscription(topics)
|
||||
self._client.set_topics(self._subscription.group_subscription())
|
||||
|
||||
|
Reference in New Issue
Block a user