io.streamthoughts.kafka.specs.command.WithAdminClientCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kafka-specs Show documentation
Show all versions of kafka-specs Show documentation
Tool to ease and automate Apache Kafka cluster configuration management
The newest version!
package io.streamthoughts.kafka.specs.command;
import io.streamthoughts.kafka.specs.KafkaSpecs;
import io.streamthoughts.kafka.specs.internal.AdminClientUtils;
import org.apache.kafka.clients.admin.AdminClient;
import picocli.CommandLine;
import picocli.CommandLine.ParentCommand;
import java.util.function.Function;
public class WithAdminClientCommand {
@ParentCommand
private KafkaSpecs specs;
public Integer withAdminClient(final Function function) {
try (AdminClient client = AdminClientUtils.newAdminClient(
specs.options.bootstrapServer,
specs.options.clientCommandConfig,
specs.options.clientCommandProperties
)) {
return function.apply(client);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy