Skip to content

Commit

Permalink
KAFKA-18811: changed command.config to admin.client.config
Browse files Browse the repository at this point in the history
  • Loading branch information
chirag-wadhwa5 committed Mar 5, 2025
1 parent 8a332ab commit 1cb6819
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -557,11 +557,11 @@ private static ArgumentParser argParser() {
.metavar("CONFIG_FILE")
.help("Consumer config properties file (config options shared with command line parameters will be overridden).");

parser.addArgument("--command.config")
parser.addArgument("--admin.client.config")
.action(store())
.required(false)
.type(String.class)
.metavar("COMMAND_CONFIG_FILE")
.metavar("ADMIN_CLIENT_CONFIG_FILE")
.help("Property file containing configs to be passed to Admin Client. ");

return parser;
Expand All @@ -574,7 +574,7 @@ public static VerifiableShareConsumer createFromArgs(ArgumentParser parser, Stri
AcknowledgementMode.valueOf(res.getString("acknowledgementMode").toUpperCase(Locale.ROOT));
String offsetResetStrategy = res.getString("offsetResetStrategy").toLowerCase(Locale.ROOT);
String configFile = res.getString("consumer.config");
String commandConfigFile = res.getString("command.config");
String adminClientConfigFile = res.getString("admin.client.config");
String brokerHostandPort = res.getString("bootstrapServer");

Properties consumerProps = new Properties();
Expand All @@ -600,9 +600,9 @@ public static VerifiableShareConsumer createFromArgs(ArgumentParser parser, Stri
KafkaShareConsumer<String, String> consumer = new KafkaShareConsumer<>(consumerProps, deserializer, deserializer);

Properties adminClientProps = new Properties();
if (commandConfigFile != null) {
if (adminClientConfigFile != null) {
try {
adminClientProps.putAll(Utils.loadProps(commandConfigFile));
adminClientProps.putAll(Utils.loadProps(adminClientConfigFile));
} catch (IOException e) {
throw new ArgumentParserException(e.getMessage(), parser);
}
Expand All @@ -622,7 +622,6 @@ public static VerifiableShareConsumer createFromArgs(ArgumentParser parser, Stri
groupId,
verbose);
}

public static void main(String[] args) {
ArgumentParser parser = argParser();
if (args.length == 0) {
Expand Down

0 comments on commit 1cb6819

Please sign in to comment.