compile group: 'org.apache.kafka', name: 'kafka-clients', version: '2.5.0'
roperties properties = new Properties();
properties.put("bootstrap.servers", "localhost:9092");
properties.put("connections.max.idle.ms", 10000);
properties.put("request.timeout.ms", 5000);
final AdminClient adminClient = AdminClient.create(properties);
final CreateTopicsResult result = adminClient.createTopics(Arrays.asList(
new NewTopic("some-topic", 10, (short) 1)
));
result.all().get();
System.out.println(result);
kafka client commands, kafka commands