package com.oldwang.kafka_admin_client;
import org.apache.kafka.clients.admin.*;
import org.apache.kafka.clients.consumer.ConsumerRecords;
import org.apache.kafka.common.config.ConfigResource;
import java.util.*;
import java.util.concurrent.ExecutionException;
/**
* @author oldwang
* 使用api操作topic配置信息
*/
public class KafkaAdminClientConfigApi {
static String brokerList = "localhost:9092";
static String topic = "kafka-admin";
public static void main(String[] args) {
// describeTopicConfig();
// alterTopicConfig();
createPartitions();
}
/**
* topic增加分区
*/
private static void createPartitions() {
Properties properties = new
api操作Kafka-config
最新推荐文章于 2024-07-25 18:54:36 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)