Error: Configuration is not defined: topic

Error: Configuration is not defined: topic

我的 Kafka Connect 位于 Kubernetes 集群中,该集群在连接器文件夹中有 mongo-kafka-connect-1.1.0-all.jar

我已将 Kafka Connect 服务端口转发到我的本地主机,并尝试使用此 curl 命令上传 Mongo 接收器连接器的属性(显然,在相关的 [=13] 中有我自己的连接详细信息=] 个地方):

curl -X PUT http://localhost:8083/connectors/sink-mongodb/config -H "Content-Type: application/json" -d '{
      "connector.class":"com.mongodb.kafka.connect.MongoSinkConnector",
      "tasks.max":"1",
      "topics":"<topic name>",
      "connection.uri":"mongodb://<username>:<password>@<uri1>:<port1>,<uri2>:<port2>",
      "database":"<database name>",
      "collection":"<collection name>",
      "key.converter":"org.apache.kafka.connect.storage.StringConverter",
      "key.converter.schemas.enable":false,
      "value.converter":"org.apache.kafka.connect.json.JsonConverter",
      "value.converter.schemas.enable":false
}'

但是,我收到以下错误响应:

{"error_code":400,"message":"Connector configuration is invalid and contains the following 1 error(s):\nConfiguration is not defined: topic\nUnable to connect to the server.\nYou can also find the above list of errors at the endpoint `/{connectorType}/config/validate`"}

我的配置有问题吗,是不是漏了什么?

我遇到了同样的问题。将 docker 图像从 mongo:4.0.xenial 更改为 mongo:4.0.4 解决了问题。

我尝试使用 1.0.1 而不是 1.1.0 —— 即 mongo-kafka-connect-1.0.1-all.jar —— 作为插件,这个错误消失了。

所以最后,问题是我需要获取 .pem 文件并将其转换为 .crt 并将其添加到服务器的 CA 列表中。基本上服务器不接受 SSL 证书并拒绝连接。