...
Sometimes people want to reset the stream application sooner but blocked by the left-over members inside the group coordinator, which only expires after session timeout. When user configures a long session timeout, it could prevent the group from clearing. We should consider adding the support to clean up members by forcing them to leave the group. To do that,
...
Code Block | ||
---|---|---|
| ||
public class MemberToRemove { // deprecated methods @Deprecated private String memberId; // newly added methods public MemberToRemove() {} public MemberToRemove withGroupInstanceId(String groupInstanceId) {} public MemberToRemove withMemberId(String memberId) {} } |
kafkaAdminClient related changes:
Code Block | ||
---|---|---|
| ||
public class RemoveMembersFromConsumerGroupOptions {
// newly added field
private boolean removeAll;
// newly added constructor
public RemoveMembersFromConsumerGroupOptions(Collection<MemberToRemove> members, Boolean removeAll) {}
} |
Code Block | ||
---|---|---|
| ||
public class RemoveMembersFromConsumerGroupResult {
// newly added fields
private final boolean removeAll;
}
|
CmdLine API change:
Code Block | ||
---|---|---|
| ||
forceOption = optionParser.accepts("force", "Force remove members when long session time out has been configured, please make sure to shut down all stream applications when this option is specified to avoid unexpected rebalances") |
...
KIP-571 plan to support the ability to force remove members in StreamsResetter, this involves 2 public interfaces changes as below:1)
- Changes in org.apache.kafka.clients.admin.MemberToRemove
Previously the KafkaAdminClient#removeMembersFromConsumerGroup only supports to remove members by specifying the groupInstanceId, which means it only supports the removal of static members, so the memberId is added to support removing dynamic members. Since there are two String fields now, new helpers are added and the old constructor will be deprecated.
2) Cha
3) Add cmdline option --force to StreamsResetter
...