如何使用融合的rest api创建kafka主题

问题描述

端点:http://localhost:8082/v3/clusters/cluster-id/topics

帖子正文:{ "topic_name": "topic-X",“partitions_count”:1, “复制因子”:1, “配置”:[ { "name": "cleanup.policy",“价值”:“紧凑” },{ "name": "compression.type",“值”:“gzip” } ] }

异常:java.lang.NullPointerException:无法调用“io.confluent.kafkarest.entities.v3.CreatetopicRequest.getTopicName()”,因为“request”为空 在 io.confluent.kafkarest.resources.v3.TopicsResource.createtopic(TopicsResource.java:137)

解决方法

将端口从 8082 更改为 8090 后可以创建主题 端点:http://localhost:8090/v3/clusters/cluster-id/topics。

几件事。 根据汇合文档默认侦听器是 8082,不确定 8090 端口配置

听众

类型:列表 默认值:http://0.0.0.0:8082 重要性:高

https://docs.confluent.io/platform/current/kafka-rest/production-deployment/rest-proxy/config.html