Kafka to database docker config

hi i used this link

its okey but i want create volume for kafka-connect container and add this config to a file because i dont want run this command

curl -X PUT http://localhost:8083/connectors/sink-jdbc-mysql-0501-json/config
-H “Content-Type: application/json” -d ‘{
“connector.class” : “io.confluent.connect.jdbc.JdbcSinkConnector”,
“connection.url” : “jdbc:mysql://mysql:3306/demo”,
“topics” : “mail”,
“key.converter” : “org.apache.kafka.connect.storage.StringConverter”,
“value.converter” : “org.apache.kafka.connect.json.JsonConverter”,
“value.converter.schemas.enable”: “true”,
“connection.user” : “root”,
“connection.password” : “Admin123”,
“auto.create” : true,
“auto.evolve” : true,
“insert.mode” : “insert”
}’

is there any way i put this config to a file ? if yes how?
thank you

You could update the command section of the Docker Compose file to start the connector instead of just installing the plugin. And then you could have the script reside in a mapped volume, as in the pattern example here.

Does that meet your requirement? Why don’t you want to run the curl command?

1 Like

I thought Kafka Connect has a config file I can put there, allowing me to write a complete Docker Compose. If I run it, I won’t need to run the curl command, so I think I should write a script for that
thank you for your help

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.