0

I want to put conf.put("command-config", "client_security.properties"); as apart of configuration in my AdminClient for Kafka java, but its not working.

https://cwiki.apache.org/confluence/display/KAFKA/KIP-377%3A+TopicCommand+to+use+AdminClient

Some help is provided here but not able to implement it

I have tried below:

    public static void main(String[] args) throws ExecutionException, InterruptedException {
    AdminClient client = null;

        Map<String, Object> conf = new HashMap<>();
        conf.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, "");
        conf.put(AdminClientConfig.REQUEST_TIMEOUT_MS_CONFIG, "1000");
        client = AdminClient.create(conf);

    ListTopicsResult ltr = client.listTopics();
    KafkaFuture<Set<String>> names = ltr.names();
    System.out.println(names.get());

}
OneCricketeer
  • 179,855
  • 19
  • 132
  • 245

1 Answers1

0

--command-config is a CLI argument only, not a AdminClient property

You can directly read your property file into a Properties object to accomplish the same thing

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245