返回到文章

采纳

编辑于

The broker does not support CREATE_PARTITIONS

kafka

AdminClient client = AdminClient.create(props);
List<ConfigEntry> entities = new ArrayList<>();
for (String key : topicParam.getConfig().keySet()) {
    ConfigEntry entity = new ConfigEntry(key, topicParam.getConfig().get(key));
    entities.add(entity);
}
Map<ConfigResource, Config> configs = new HashMap<>();
configs.put(new ConfigResource(ConfigResource.Type.TOPIC,"topic", new Config(entities));
AlterConfigsResult rs = client.alterConfigs(configs);
rs.all().get();

adminclient在增加分区的时候爆出来的 ,请问 我调脚本就可以操作这是什么情况