/** * Describe some group IDs in the cluster, with the default options. * <p> * This is a convenience method for * #{@link AdminClient#describeConsumerGroups(Collection, DescribeConsumerGroupsOptions)} with * default options. See the overload for more details. * * @param groupIds The IDs of the groups to describe. * @return The DescribeConsumerGroupResult. */ public DescribeConsumerGroupsResult describeConsumerGroups(Collection<String> groupIds) { return describeConsumerGroups(groupIds, new DescribeConsumerGroupsOptions()); }
private void validateNoActiveConsumers(final String groupId, final AdminClient adminClient) throws ExecutionException, InterruptedException { final DescribeConsumerGroupsResult describeResult = adminClient.describeConsumerGroups(Arrays.asList(groupId), (new DescribeConsumerGroupsOptions()).timeoutMs(10 * 1000)); final List<MemberDescription> members = new ArrayList<MemberDescription>(describeResult.describedGroups().get(groupId).get().members()); if (!members.isEmpty()) { throw new IllegalStateException("Consumer group '" + groupId + "' is still active " + "and has following members: " + members + ". " + "Make sure to stop all running application instances before running the reset tool."); } }
private void validateNoActiveConsumers(final String groupId, final AdminClient adminClient) throws ExecutionException, InterruptedException { final DescribeConsumerGroupsResult describeResult = adminClient.describeConsumerGroups(Arrays.asList(groupId), (new DescribeConsumerGroupsOptions()).timeoutMs(10 * 1000)); final List<MemberDescription> members = new ArrayList<MemberDescription>(describeResult.describedGroups().get(groupId).get().members()); if (!members.isEmpty()) { throw new IllegalStateException("Consumer group '" + groupId + "' is still active " + "and has following members: " + members + ". " + "Make sure to stop all running application instances before running the reset tool."); } }
private void validateNoActiveConsumers(final String groupId, final AdminClient adminClient) throws ExecutionException, InterruptedException { final DescribeConsumerGroupsResult describeResult = adminClient.describeConsumerGroups(Arrays.asList(groupId), (new DescribeConsumerGroupsOptions()).timeoutMs(10 * 1000)); final List<MemberDescription> members = new ArrayList<MemberDescription>(describeResult.describedGroups().get(groupId).get().members()); if (!members.isEmpty()) { throw new IllegalStateException("Consumer group '" + groupId + "' is still active " + "and has following members: " + members + ". " + "Make sure to stop all running application instances before running the reset tool."); } }
private void validateNoActiveConsumers(final String groupId, final AdminClient adminClient) throws ExecutionException, InterruptedException { final DescribeConsumerGroupsResult describeResult = adminClient.describeConsumerGroups(Arrays.asList(groupId), (new DescribeConsumerGroupsOptions()).timeoutMs(10 * 1000)); final List<MemberDescription> members = new ArrayList<MemberDescription>(describeResult.describedGroups().get(groupId).get().members()); if (!members.isEmpty()) { throw new IllegalStateException("Consumer group '" + groupId + "' is still active " + "and has following members: " + members + ". " + "Make sure to stop all running application instances before running the reset tool."); } }