-
Notifications
You must be signed in to change notification settings - Fork 699
Description
Context
We maintain a shared library used by multiple Kafka consumers. We want to migrate to the KIP-848 consumer protocol in an opt-in way, so during the migration we must support both:
- Classic protocol (
group.protocol=classic, ordefault): rebalance callback usesAssign()/Unassign(). - New consumer protocol (
group.protocol=consumer): rebalance callback usesIncrementalAssign()/IncrementalUnassign()only, as described in the KIP-848 migration guide.
We plan to branch in the rebalance callback based on the current protocol (two-way: classic vs new) and call the appropriate assign APIs.
Current behavior / documentation
We intended to use GetRebalanceProtocol() to detect which protocol is in use. The in-code comment currently says:
// GetRebalanceProtocol returns the current consumer group rebalance protocol,
// which is either "EAGER" or "COOPERATIVE".
// If the rebalance protocol is not known in the current state an empty string
// is returned.
// Should typically only be called during rebalancing.
func (c *Consumer) GetRebalanceProtocol() string {.}
That only describes the classic protocol (eager vs cooperative assignors). It does not say what is returned when group.protocol=consumer (KIP-848), where there is no client-side EAGER/COOPERATIVE choice and the protocol is fully incremental.
Question
What does GetRebalanceProtocol() return in this case? (e.g. "consumer", "COOPERATIVE", something else, or is it unspecified?)
Environment
- confluent-kafka-go: v2.13.0
- go: v1.23.5