arnabnandy7 opened a new pull request, #22908:
URL: https://github.com/apache/kafka/pull/22908

   ## Description
   
   `AbstractResponse.shouldClientThrottle()` previously defaulted to `false`. 
As a result, newer response types containing a `throttleTimeMs` field did not 
enable client-side throttling unless they explicitly overrode this method.
   
   This change derives the default behavior from the response schema. A client 
now throttles when the response schema for the negotiated API version contains 
the `throttle_time_ms` field.
   
   Existing overrides remain unchanged to preserve historical version-specific 
throttling behavior for older APIs.
   
   This fixes client-side throttling for:
   
   - `ConsumerGroupHeartbeatResponse`
   - `ShareGroupHeartbeatResponse`
   - `StreamsGroupHeartbeatResponse`
   
   It also prevents newly added response types with a throttle-time field from 
accidentally omitting the required behavior.
   
   ## Testing
   
   Added regression coverage for every supported version of the affected 
heartbeat APIs, verifying that `shouldClientThrottle()` returns `true`.
   
   The following checks passed:
   
   - `clients:test --tests org.apache.kafka.common.requests.RequestResponseTest`
   - `clients:checkstyleMain`
   - `clients:checkstyleTest`
   - `spotlessCheck`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to