What is ApiVersions?
Sent by every client on every new connection to discover what API versions the broker supports. UNSUPPORTED_VERSION errors in client logs appear when a client is newer than the broker; this API prevents that by letting the client downgrade gracefully.
| Version | Kafka | Changes |
|---|---|---|
| ApiVersionsRequest | ||
| v0 | 2.2 | through 2 of ApiVersionsRequest are the same. |
| v1 | 2.2 | No changes |
| v2 | 2.2 | No changes |
| v3 | 2.4 | + ClientSoftwareName string+ ClientSoftwareVersion string~ Flexible encoding enabled FLEXIBLE is the first flexible version and adds ClientSoftwareName and ClientSoftwareVersion. |
| v4 | 3.9 | fixes KAFKA-17011, which blocked SupportedFeatures.MinVersion in the response from being 0. |
| ApiVersionsResponse | ||
| v0 | 2.2 | + ErrorCode int16+ ApiKeys []ApiVersion+ ApiKey int16+ MinVersion int16+ MaxVersion int16 |
| v1 | 2.2 | + ThrottleTimeMs int32adds throttle time to the response. |
| v2 | 2.2 | on quota violation, brokers send out responses before throttling. |
| v3 | 2.4 | + SupportedFeatures []SupportedFeatureKey+ Name string+ MinVersion int16+ MaxVersion int16+ FinalizedFeaturesEpoch int64+ FinalizedFeatures []FinalizedFeatureKey+ Name string+ MaxVersionLevel int16+ MinVersionLevel int16+ ZkMigrationReady bool~ Flexible encoding enabled FLEXIBLE is the first flexible version. Tagged fields are only supported in the body but not in the header. The length of the header must not change in order to guarantee the backward compatibility. Starting from Apache Kafka 2.4 (KIP-511), ApiKeys field is populated with the supported versions of the ApiVersionsRequest when an UNSUPPORTED_VERSION error is returned. |
| v4 | 3.9 | fixes KAFKA-17011, which blocked SupportedFeatures.MinVersion from being 0. |