11/*
22 * MIT License
33 *
4- * Copyright (c) 2025 bakdata
4+ * Copyright (c) 2026 bakdata
55 *
66 * Permission is hereby granted, free of charge, to any person obtaining a copy
77 * of this software and associated documentation files (the "Software"), to deal
3434import lombok .extern .slf4j .Slf4j ;
3535import org .apache .kafka .clients .admin .Admin ;
3636import org .apache .kafka .clients .admin .ConsumerGroupDescription ;
37- import org .apache .kafka .clients .admin .ConsumerGroupListing ;
3837import org .apache .kafka .clients .admin .DeleteConsumerGroupsResult ;
3938import org .apache .kafka .clients .admin .DescribeConsumerGroupsResult ;
39+ import org .apache .kafka .clients .admin .GroupListing ;
4040import org .apache .kafka .clients .admin .ListConsumerGroupOffsetsResult ;
41- import org .apache .kafka .clients .admin .ListConsumerGroupsResult ;
41+ import org .apache .kafka .clients .admin .ListGroupsResult ;
4242import org .apache .kafka .clients .consumer .OffsetAndMetadata ;
4343import org .apache .kafka .common .KafkaFuture ;
4444import org .apache .kafka .common .TopicPartition ;
@@ -61,8 +61,8 @@ public final class ConsumerGroupsClient {
6161 *
6262 * @return consumer groups
6363 */
64- public Collection <ConsumerGroupListing > list () {
65- final ListConsumerGroupsResult result = this .adminClient .listConsumerGroups ();
64+ public Collection <GroupListing > list () {
65+ final ListGroupsResult result = this .adminClient .listGroups ();
6666 return this .timeout .get (result .all (), () -> "Failed to list consumer groups" );
6767 }
6868
@@ -142,7 +142,7 @@ public Map<TopicPartition, OffsetAndMetadata> listOffsets() {
142142 * @return whether a Kafka consumer group with the specified name exists or not
143143 */
144144 public boolean exists () {
145- final Collection <ConsumerGroupListing > consumerGroups = ConsumerGroupsClient .this .list ();
145+ final Collection <GroupListing > consumerGroups = ConsumerGroupsClient .this .list ();
146146 return consumerGroups .stream ()
147147 .anyMatch (this ::isThisGroup );
148148 }
@@ -170,7 +170,7 @@ public ConfigClient config() {
170170 new ConfigResource (Type .GROUP , this .groupName ));
171171 }
172172
173- private boolean isThisGroup (final ConsumerGroupListing listing ) {
173+ private boolean isThisGroup (final GroupListing listing ) {
174174 return listing .groupId ().equals (this .groupName );
175175 }
176176
0 commit comments