主题管理
创建主题
public void create(String topic, int partitions, int replication, Map<String, String> configs) throws Exception {
if (replication > getBrokerNums())
throw new RuntimeException("副本系数不能大于broker节点数量");
short replication_short = (short) replication;
NewTopic newTopic = new NewTopic(topic, partitions, replication_short);
if (null != configs && configs.size() > 0)
newTopic.configs(configs);
CreateTopicsResult result = adminClient.createTopics(Arrays.asList(newTopic));
result.all().get(timeout