mongodb - Error: Configuration is not defined: topic
问题描述
My Kafka Connect is sitting in a Kubernetes cluster which has the mongo-kafka-connect-1.1.0-all.jar
in the connectors folder.
I have port forwarded the Kafka Connect service to my localhost and am trying to upload the properties for a Mongo Sink Connector with this curl command (obviously, with my own connection details in the relevant <>
places):
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
}'
However, I get the following error response:
{"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`"}
Is my config wrong, am I missing something?
解决方案
I tried 1.0.1 instead of 1.1.0 — that is, mongo-kafka-connect-1.0.1-all.jar — as the plugin, and this error disappeared.
推荐阅读
- dart - Flutter - 未定义边界参数
- xamarin.forms - 如何在 Xamarin.Forms 和 MvxListView 中管理事件到命令
- java - Java:单击鼠标时模拟按键?
- python - 设置标志以使项目不可选择,稍后再选择
- android - 用于字幕 alpha 的 Surfaceview/TextureView 不起作用
- javascript - 泳道/ngx-datatable,如何在条件下禁用复选框?
- java - JAXB 的 Unmarshal() 方法返回一个空对象
- tensorflow - Tensorflow:存储在模型中
- mysql - 钥匙圈 mysql 谷歌云
- python - 如何在python中使用pydot附加2个图(graph1和graph2)