What is ApiVersions?
Clients can use this API to discover version ranges advertised by the connected broker or controller. The result depends on the listener and enabled features. Clients may select a mutually supported version; this does not guarantee semantic compatibility, and unsupported-version errors still require handling. ApiVersions responses always use response header v0, including flexible bodies.
| 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. |
| v5 | 4.4 | + ClusterId string+ NodeId int32introduces ClusterId and NodeId checking and REBOOTSTRAP_REQUIRED error (KIP-1242). |
| 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. |
| v5 | 4.4 | introduces ClusterId and NodeId checking and REBOOTSTRAP_REQUIRED error (KIP-1242). |