Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Use client instance ID as member ID too

...

Proposed Changes

This KIP proposes two three changes to the Kafka protocol.

...

In KIP-714, the client instance ID was created by the broker which responded to a client's first GetTelemetrySubscriptions RPC. In KIP-848, the member ID was created by the group coordinator in response to a heartbeat, but subsequently KIP-1082 changed this so that the client created its own member ID. As a result, this KIP also changes the definition of the client instance ID so that the client creates it. After this KIP, when the client makes its first GetTelemetrySubscriptions request, it supplies the client instance ID which it has already created rather than specifying a zero client instance ID; the Apache Kafka Java client no longer supplies a zero client instance ID on GetTelemetrySubscriptions requests. The original behavior of KIP-714 is still supported for clients which do not yet send ClientInstanceId in the request header; they just specify a zero client instance ID in their first GetTelemetrySubscriptions request and then receive a client instance ID to use for client telemetry calculated by the broker in its response.

Member ID in group protocols

Consumer groups with the consumer group protocol (KIP-848 and KIP-1082), share groups (KIP-932) and streams groups (KIP-1071) all make use of a client-generated UUID as the member ID. This KIP proposes using the same client-generated UUID as the client instance ID and the member ID. This makes no change to the protocol at all. It simply creates a single UUID when a client is constructed, and when a client-generated member ID is required for the group protocol, it uses the client instance ID.

Client ID

This KIP also proposes a second change to the Kafka protocol. It proposes sending the client ID only on the initial request on each connection, and then sending a null client ID for all subsequent requests. This eliminates the unnecessary overhead of repeatedly sending the same client ID string to the broker on every request. The initial client ID for each connection will be cached by the broker (this is an implementation detail, but caching it in the ChannelMetadataRegistry is an option). After this KIP, the broker will assume that the client ID from the initial request applies to all subsequent requests on a connection, and it will ignore the client ID specified on any subsequent requests.

...