New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule engine: Kafka consumer group per partition #10728
base: master
Are you sure you want to change the base?
Rule engine: Kafka consumer group per partition #10728
Conversation
Is there any proof that this is solving the problem of re-balancing performance? |
Kafka consumer groups perform a rebalancing process each time a consumer joins (subscribes) or leaves (unsubscribes) the group. This is necessary to ensure that the partitions of the topics being consumed are evenly distributed among the available consumers in the group. Here’s a brief overview of how rebalancing works in a Kafka consumer group:
About the ThingsBoard-specific usage of KafkaGive: Each consumer in the group subscribes to a different topic, and there is no overlap in the topics they consume. Even in this scenario, where each consumer is consuming a separate topic, Kafka's consumer group coordination doesn't inherently recognize or optimize for the fact that there is no direct competition for partitions among consumers. The group coordinator does not have the logic to bypass rebalancing when each consumer subscribes to a unique topic. The fundamental behavior of triggering a rebalance on join or leave events is still followed. |
…a fully async repartition experience
Rule engine: Kafka consumer group per partition
Many rule engine's “.topic.” served under a single consumer group:
re-LowPriority-consumer
tb_rule_engine.LowPriority.1
tb_rule_engine.LowPriority.2
tb_rule_engine.LowPriority.3
The problem: one fail - all rebalancing
The solution: use consumer group per topic.partition
Hint: Regarding Kafka partition, we always use a single partition 0. ThingsBoard partition are simple the part a topic name like “*.topic.number”
Tests passed:
General checklist
Front-End feature checklist
Back-End feature checklist