Table of Contents |
---|
This page is meant as a template for writing a KIP. To create a KIP choose Tools->Copy on this page and modify with your content and replace the heading with the next KIP number and a description of your issue. Replace anything in italics with your own description.
Status
Current state: Under Discussion
...
JIRA: https://issues.apache.org/jira/browse/KAFKA-9440
Motivation
We introduced a new AdminClient API removeMembersFromConsumerGroup in 2.4. It would be good to instantiate the API as part of the ConsumerGroupCommand for easy command line usage.
We can add new option (--remove-members) to remove members from group in ConsumerGroupCommand. Users can either remove member by providing member id (--member) or can delete all the members of group using (--all-members) option.
...
Code Block | ||
---|---|---|
| ||
/** * Remove members from the consumer group by given member identities. * <p> * For possible error codes, refer to {@link LeaveGroupResponse}. * * @param groupId The ID of the group to remove member from. * @param memberIds The groupInstanceIds of the members te be removed. * @return The MembershipChangeResult. */ RemoveMembersFromConsumerGroupResult removeMembersFromConsumerGroup(String groupId, Collection<String> memberIds); |
Proposed Changes
Implementation of newly created API method will delegate the call to existing API after building remove member options object from given memberIds
...
Code Block | ||
---|---|---|
| ||
def deleteMembersFromConsumerGroup(): Boolean = { val groupId = opts.options.valueOf(opts.groupOpt) val result = if (opts.options.has(opts.allMembersOpts)) { adminClient.removeMembersFromConsumerGroup(groupId, new RemoveMembersFromConsumerGroupOptions) } else { val memberIds = opts.options.valuesOf(opts.memberOpt).asScala adminClient.removeMembersFromConsumerGroup(groupId, memberIds.asJava) } try { result.all.get println("Deletion of requested member(s) of consumer group was successful.") return true } catch { case e: Throwable => { printError(s"Deletion of requested member(s) of consumer group failed due to ${e.getMessage}") return false } } false } |
Compatibility, Deprecation, and Migration Plan
No users will be impacted as this is just addition of two new methods.
Rejected Alternatives
None