skip to content

As a platform lead, would you move your Kafka consumer fleet to group.protocol=consumer now or wait for the 5.0 default flip, and how would you stage it?

level: principalimportance: should knowfreq 22%

answer

  1. the deadline is a default, not removal
  2. who owns the timeouts afterwards
  3. inventory the assignors first
  4. canary groups and a policy guardrail

basics

~20 s

Usually migrate deliberately before 5.0 rather than inherit the flip: inventory blockers such as custom assignors and enforceRebalance calls, settle who owns broker-side timeouts, then roll group by group behind the migration policy guardrail with rollback rehearsed.

solid answer

~40 s

There is no forced deadline in 4.x: Kafka 4.0 made the consumer protocol GA, but `KafkaConsumer` defaults to `classic` until 5.0 is expected to flip it, and KIP-1274 plans `KafkaConsumer` to support only the consumer protocol from 6.0. Waiting costs nothing today but means the flip lands in whichever release a team upgrades to, possibly unplanned. Migrating now buys incremental rebalances and broker-side regex, but it moves liveness and assignment into broker configs the platform team must own, and it blocks groups that depend on custom client-side assignors, rack-aware assignment the docs call not fully supported, or `enforceRebalance()`. I would migrate deliberately before 5.0: inventory those blockers, decide timeout ownership and per-group overrides, canary a few rebalance-heavy groups online, then roll the rest group by group, keeping `bidirectional` migration so rollback stays a redeploy.

go deeper

for a junior

Recall the timeline: GA in 4.0, the client default still classic, a default flip planned for 5.0 and classic support leaving KafkaConsumer in 6.0.

for a middle

List the concrete blockers: rejected client configs, custom client-side assignors, rack-aware assignment not fully supported, and enforceRebalance() becoming a no-op.

for a senior

Show how you would canary the change online, measure rebalance time and lag, and keep rollback cheap with the bidirectional migration policy.

for a principal

Own the trade-off: cheaper rebalances against centralised liveness and assignor control, and set the policy for who changes broker group configs and how stragglers are pinned and tracked.

## The decision in front of you Kafka 4.0 made the KIP-848 consumer group protocol generally available, but every `KafkaConsumer` in your fleet keeps using the **classic** protocol until it is configured with `group.protocol=consumer`. According to the Kafka docs, the evolution timeline described in KIP-1274 is expected to be: - **5.0**: `KafkaConsumer` defaults to the consumer protocol, while still supporting classic; - **6.0**: `KafkaConsumer` supports only the consumer protocol, while the broker keeps classic for backward compatibility. So the real question is not "whether" but "on whose schedule": your own, or the day a team bumps its client to 5.0 and the default changes under it. There is no single right answer; it depends on what your fleet runs and who will own the new settings. ## What migrating buys - **Cheaper rebalances.** Only members whose partitions move do any work, so deploys, autoscaling and single-pod crashes stop pausing whole groups. - **Simpler clients.** Assignment logic and timing knobs leave the application, so an assignor fix is a broker change, not a fleet-wide client upgrade. - **Broker-side regex subscription** through `subscribe(SubscriptionPattern)`, resolved by the coordinator. - **Getting ahead of 5.0** on your own schedule, with a rehearsed rollback, instead of discovering failing configs during an unrelated upgrade. ## What it costs | Cost or risk | Why it matters | |---|---| | Rejected client configs | `partition.assignment.strategy`, `session.timeout.ms` and `heartbeat.interval.ms` make the constructor throw; every service's config must be cleaned | | Centralised liveness | `group.consumer.session.timeout.ms` and the heartbeat interval become platform settings; teams that tuned their own need per-group overrides, bounded by broker min/max values | | Custom client-side assignors | not supported; the logic must be rewritten as a server-side `ConsumerGroupPartitionAssignor` deployed on brokers, or the group stays classic | | Rack-aware assignment | the docs say it is not fully supported yet, which matters if you rely on rack-local consumption to save cross-zone traffic | | `enforceRebalance()` | becomes a logged no-op, silently breaking code that forced reshuffles | | Broker load and blast radius | assignment runs on the coordinator; a bad broker assignor or config affects every group at once | | One-way cluster downgrade | once groups use the new protocol, the cluster can only be downgraded to 3.4.1 or newer | Waiting has its own costs: every month on classic is another month of barrier-based rebalances for the groups that suffer most, and a default flip that arrives with an unrelated client upgrade is the worst moment to learn which services still carry rejected configs. ## Signals that push the decision - **Migrate early** when groups are large, deploy often, autoscale, or show rebalance-driven lag; when the fleet uses only built-in assignors; when the platform team can own broker group configs. - **Hold specific groups back** when they depend on custom assignor logic or rack-aware placement, or call `enforceRebalance()`. Pin them explicitly with `group.protocol=classic` so the 5.0 flip cannot surprise them, and track the blocker. - **Leave it for later** only when rebalances are rare and cheap and the fleet will not reach 5.0 soon, and even then write the plan down. ## A staged plan 1. **Inventory.** For every group: assignor in use, any custom assignor user data, explicit timeout settings, `enforceRebalance()` calls, regex subscriptions, group size against `group.consumer.max.size`. 2. **Decide ownership.** Agree the cluster values of `group.consumer.session.timeout.ms`, the heartbeat interval and `group.consumer.assignors`, and the process for per-group overrides through group-level configs. 3. **Guardrails.** Keep `group.consumer.migration.policy=bidirectional` so a rollback is just a redeploy; the `upgrade`, `downgrade` and `disabled` values exist if you need to stop movement in one direction. 4. **Canary.** Convert a few rebalance-heavy but low-risk groups online, one pod at a time, and compare rebalance duration and lag before and after. 5. **Roll out by group**, not by cluster, with the config change in a shared client library so new services start on the consumer protocol. 6. **Pin the stragglers** to classic explicitly, each with an owner and a trigger for revisiting. ## How to answer in the room A strong answer states the timeline precisely (GA in 4.0, client default still classic, flip planned for 5.0, classic-only removal from `KafkaConsumer` planned for 6.0), names concrete blockers rather than "risk", and treats the change as a transfer of ownership from application teams to the platform team, with the guardrails and rollback that this requires.

  • How do you stop the 5.0 default flip from silently moving a group that is not ready?
    Set `group.protocol=classic` explicitly in that service's consumer config now. An explicit value does not change when the default does, so the group stays classic on a 5.x client. Record the blocker, such as a custom assignor, with an owner, because KIP-1274 plans `KafkaConsumer` to drop classic support in 6.0.
  • A team says its custom client-side assignor is essential. What are its options under the consumer protocol?
    Rewrite the logic as a server-side `ConsumerGroupPartitionAssignor`, which the platform team deploys on the brokers and lists in `group.consumer.assignors`; the team then names it with `group.remote.assignor`. Until then the group stays on classic, because client-side assignors are not supported by the consumer protocol.

  • Classic consumers stop working as soon as the brokers are upgraded to 4.0
  • The consumer protocol has no costs, so every group should switch at once
  • Waiting is safe because classic will never be removed from KafkaConsumer
  • Migration is a broker-only change that application teams never notice

Assumes Kafka 4.x with KIP-848 GA since 4.0; the 5.0 default flip and 6.0 classic removal from KafkaConsumer are the plan stated in KIP-1274, not released behaviour.