If you create a new consumer inside the assign method (and assuming you actually start polling with it so that it sends the JoinGroup request), then yes, it would need a new rebalance to accommodate this consumer. The group coordinator will inform all the existing members to rejoin the group so that the rebalance can proceed with the latest up-to-date view of the current group.
On Wed, Feb 24, 2021 at 7:58 AM Mazen Ezzeddine < mazen.ezzedd...@etu.univ-cotedazur.fr> wrote: > I am running a Kafka cluster on Kubernetes. I am implementing a custom > PartitionAssignor to personalize the way topic partitions are assigned to > existing consumers in the consumer group. To this end, I am overriding the > method Map<String, Assignment> assign( Cluster metadata, Map<String, > Subscription> subscriptions) > > > If inside the assign method I dynamically created a new consumer through > the Kubernetes client APIs, how would the rebalancing protocol behave in > such case. Precisely, when the newly created consumer send a joinGroup > request to the group coordinator(while the rebalancing process is still in > progress), would the current in progress rebalancing completes, and then a > new rebalance process is triggered to accommodate for the newly created > consumer? > > > Thanks. > >