From 1a3aca305e7f51dc491723b80c3d60b4ba4b6f1d Mon Sep 17 00:00:00 2001 From: vamossagar12 Date: Mon, 23 Oct 2023 15:12:21 +0530 Subject: [PATCH] KAFKA-15457: Add support for OffsetFetch version 9 in admin client (#14611) This patch adds support for OffsetFetch version 9 in the admin client. It mainly allows handling two new error codes `STALE_MEMBER_EPOCH` and `UNKNOWN_MEMBER_ID` introduced as part of KIP-848. Reviewers: David Jacot --- .../admin/internals/ListConsumerGroupOffsetsHandler.java | 2 ++ .../org/apache/kafka/common/requests/OffsetFetchResponse.java | 2 ++ .../org/apache/kafka/clients/admin/KafkaAdminClientTest.java | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/clients/src/main/java/org/apache/kafka/clients/admin/internals/ListConsumerGroupOffsetsHandler.java b/clients/src/main/java/org/apache/kafka/clients/admin/internals/ListConsumerGroupOffsetsHandler.java index 21c7d8d488f..8fee665ac37 100644 --- a/clients/src/main/java/org/apache/kafka/clients/admin/internals/ListConsumerGroupOffsetsHandler.java +++ b/clients/src/main/java/org/apache/kafka/clients/admin/internals/ListConsumerGroupOffsetsHandler.java @@ -165,6 +165,8 @@ public class ListConsumerGroupOffsetsHandler implements AdminApiHandler nonRetriableErrors = Arrays.asList( - Errors.GROUP_AUTHORIZATION_FAILED, Errors.INVALID_GROUP_ID, Errors.GROUP_ID_NOT_FOUND); + Errors.GROUP_AUTHORIZATION_FAILED, Errors.INVALID_GROUP_ID, Errors.GROUP_ID_NOT_FOUND, + Errors.UNKNOWN_MEMBER_ID, Errors.STALE_MEMBER_EPOCH); try (AdminClientUnitTestEnv env = new AdminClientUnitTestEnv(mockCluster(1, 0))) { env.kafkaClient().setNodeApiVersions(NodeApiVersions.create());