在linux中,我们可以使用curl命令运行此代码,但我需要windows平台的命令
POST /connectors HTTPS
Host:
Authorization: Basic Auth (Provide the credentials used when creating the cluster)
Content-Type: application/json
{
"name": "myconnectorname",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"tasks.max": "1",
"topics": "mytopic",
"connection.url": "jdbc:mysql://<mymysqlurl>:<portnumber>/schemaname",
"connection.user": "myusername",
"connection.password": "mypassword",
"connection.password.secure.key": "mycredentialstorekey",
"auto.create": "true",
"key.converter": "io.confluent.connect.avro.AvroConverter",
"value.converter": "io.confluent.connect.avro.AvroConverter"
}
}
您可以使用任何REST客户端,如PostMan或Insomnia。
Powershell还有一个HTTP客户端,类似于cURL,或者您可以在Windows中使用cURL,也可以使用WSL。
Github 上也有Kafka Connect用户界面项目