Quick revision
The short answer
First confirm the prerequisites: brokers with the new group coordinator protocol enabled, client libraries that support group.protocol=consumer (Java 4.x clients; each Go and Python library checked separately) and Spring Kafka versions that pass the setting through. Then find groups that depend on client-side behaviour, such as custom assignors or partition.assignment.strategy, and leave them classic for now. Migrate group by group with rolling restarts, starting with low-risk Java groups, watching lag and rebalance times, treat Kafka Streams separately, and roll back by restarting members with group.protocol=classic, a path we test in staging first.
What to remember
In this answer, we planned the move of 200 groups to the new consumer group protocol in stages. We confirmed broker and client prerequisites, including each non-Java library and Spring Kafka version, inventoried groups that depend on client-side assignment or session settings, and migrated in waves, Java and low-risk groups first, with rolling restarts and close watching of lag and rebalances. Kafka Streams gets its own plan, and rollback is a rolling restart with group.protocol=classic that we rehearse in staging first.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
First confirm the prerequisites: brokers with the new group coordinator protocol enabled, client libraries that support group.protocol=consumer (Java 4.x clients; each Go and Python library checked separately) and Spring Kafka versions that pass the setting through. Then find groups that depend on client-side behaviour, such as custom assignors or partition.assignment.strategy, and leave them classic for now. Migrate group by group with rolling restarts, starting with low-risk Java groups, watching lag and rebalance times, treat Kafka Streams separately, and roll back by restarting members with group.protocol=classic, a path we test in staging first.
Why this question is asked
Moving 200 consumer groups to a new coordination protocol is a fleet change, not a configuration tweak. Most groups will switch without anyone noticing, but a few will depend on behaviour that no longer exists, and finding those before they fail is the job. Interviewers ask this scenario to see whether we plan in stages, with inventory, ordering and a tested rollback, instead of flipping a switch. In this answer, we will recap what changes for a group, then go through prerequisites, the inventory of risky groups, the order of migration, how a single group is converted, Kafka Streams, and rollback.
1A Quick Recap of What Changes for a Group
In the classic protocol, a leader consumer computes partition assignments using the assignor named in partition.assignment.strategy, and members rebalance through a JoinGroup and SyncGroup barrier. In the new protocol from KIP-848, enabled per consumer with group.protocol=consumer, the broker's group coordinator computes assignments with a server-side assignor, members coordinate through heartbeats, and the session and heartbeat timeouts become broker settings.
So anything that relied on the client computing assignments, on client-side session settings, or on the barrier itself is what can break. Everything else, such as poll loops, commits and rebalance listeners, keeps working.
2Prerequisites
On the brokers, the new protocol must be enabled in the group coordinator; on Kafka 4.x it is available by default, but we confirm the broker configuration and decide the defaults the broker will apply, such as group.consumer.session.timeout.ms (45 s) and the allowed assignors. Session-timeout overrides that teams set on the client no longer apply, so groups that relied on a long client session timeout, for example for static membership, need a broker-side or per-group setting instead.
On the clients, every library must support the protocol. The Java client does from 4.0. For Go and Python, support depends on the library and its version, for example the librdkafka-based clients gained it in later releases, so we check each library's release notes and build a table of service, language, library version and support. Spring Kafka services must be on a version that runs a Kafka 4.x client, and they set it with spring.kafka.consumer.properties.group.protocol=consumer.
3Inventory the Groups That Can Break
We list all 200 groups with their owners, languages and settings, using kafka-consumer-groups.sh --describe and the services' configuration. Then we flag the risky ones: groups with a custom assignor class, groups that set partition.assignment.strategy for a reason (for example co-partitioned topics that rely on RangeAssignor placing the same partition numbers together, which the server-side range assignor can provide), code that calls enforceRebalance() or depends on how the leader computed assignments, and groups using regex subscriptions, whose matching moves to the broker and may follow different rules.
| Group type | Example | Plan |
|---|---|---|
| Java, default settings, subscribe by name | most service consumers | Migrate early, in waves |
Java with partition.assignment.strategy | co-partitioned joins | Map to server assignor, test first |
| Custom client-side assignor | rack-pinned or weighted assignment | Stay classic; redesign |
| Go or Python client | librdkafka-based services | After checking library support |
| Kafka Streams application | stateful aggregations | Separate plan; own protocol |
The output is a simple sorting: groups that can move as they are, groups that need a small change, and groups that stay classic until they are redesigned. A custom assignor, for example, has no client-side equivalent in the new protocol.
4Order and Waves
We start in staging, with a copy of a typical Java group, and test the conversion and the rollback. In production, we begin with low-criticality Java groups owned by the platform team, then move in waves of ten to twenty groups, Java first, then other languages once their libraries are confirmed, and critical groups last, after a few weeks without surprises.
For each wave we watch consumer lag, rebalance duration, the number of rebalances per deploy and error logs, comparing them with the previous week. A wave only starts when the previous one has been stable for an agreed time, for example two working days.
5Converting One Group
A group is converted with a normal rolling restart: each member restarts with group.protocol=consumer. The broker supports a mixed state during the roll, where classic and new-protocol members belong to the same group, and converts the group to the new type when the conditions are met. The exact rules, and the broker setting that allows conversion in each direction, depend on the version, so we check them for our release and confirm the group's type afterwards with kafka-consumer-groups.sh or the admin API.
- Check client library and settingsno custom assignor, no client session overrides
- Roll members with group.protocol=consumermixed group while the roll runs
- Lag and rebalance times normal?YesMark the group migratedNoRoll back to classic
- Watch for two working daysthen start the next wave
4 steps in order. Play them, or step through them one at a time.
Every step can be undone by another rolling restart.
6Kafka Streams and Rollback
Kafka Streams applications do not use the consumer protocol switch the same way. Streams has its own rebalance logic for tasks and state stores, and its own new protocol has been developed separately, so Streams applications get their own plan and are left on their current protocol in this migration.
Rollback for a consumer group is another rolling restart with group.protocol=classic, provided the broker allows converting back, which we confirm for our version. We rehearse it in staging before the first production wave and write it into each wave's runbook, so whoever is on call can roll a group back without the migration team.
7Follow-up questions
What is the biggest risk in this migration?
A group that silently depends on how assignments were computed, for example co-partitioned topics joined in memory that relied on RangeAssignor's placement. Nothing fails loudly; the results are just wrong. That is why the inventory step looks at intent, not only at settings, and why such groups are tested before they move.
Should we change the default in a shared starter for everyone at once?
Not at first. A shared default flips every group on its next deploy, outside our wave plan. We would add the setting per service during the waves, and only make it the default once the remaining classic groups are known exceptions with an explicit classic setting.
8Conclusion
In this answer, we planned the move of 200 groups to the new consumer group protocol in stages. We confirmed broker and client prerequisites, including each non-Java library and Spring Kafka version, inventoried groups that depend on client-side assignment or session settings, and migrated in waves, Java and low-risk groups first, with rolling restarts and close watching of lag and rebalances. Kafka Streams gets its own plan, and rollback is a rolling restart with group.protocol=classic that we rehearse in staging first.
Open with
I would treat it as a fleet migration in stages. First, prerequisites: brokers with the new group coordinator protocol enabled and broker-side session and heartbeat defaults decided, because those settings move from the client to the broker.
Then, if they want more
Then client support: the Java client supports group.protocol=consumer from 4.0, but for the Go and Python services I would check each library and version, and Spring Kafka services need a version on a 4.x client.
Second, an inventory of all 200 groups, flagging the ones that rely on client-side behaviour: custom assignors, partition.assignment.strategy set on purpose, for example for co-partitioned joins, client session timeout overrides, enforceRebalance, regex subscriptions. Those either get a small change or stay classic for now.
Third, the order: staging first, including the rollback, then low-risk Java groups, then waves of ten or twenty, other languages once confirmed, critical groups last. Each group converts with a rolling restart, and I would watch lag, rebalance time and rebalances per deploy, with a couple of stable days between waves.
Kafka Streams has its own rebalance protocol, so it gets a separate plan. Rollback is another rolling restart with group.protocol=classic, which I would rehearse in staging and put in the runbook, checking the conversion rules for our exact version.
About this answer
- Last updated
- 13 November 2026
- Versions it names
- Java 4
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Apache Kafka documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Plan the migration: prerequisites, order, what can break, and how to roll back.": https://scrivio-interview-library.netlify.app/spring-boot/kafka-clients-in-depth/db23998961/