Skip to content

Instantly share code, notes, and snippets.

View postsource.cmd
: post source connector
curl -i -X POST -H "Accept:application/json" -H  "Content-Type:application/json" http://localhost:8083/connectors/ -d @source.json
: post sink connector
curl -i -X POST -H "Accept:application/json" -H  "Content-Type:application/json" http://localhost:8083/connectors/ -d @sink.json
: list connectors
curl -i -X GET -H "Accept:application/json" http://localhost:8083/connectors
: connector status
View sinkconnector.json
{
"name": "jdbc-sink",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"tasks.max": "1",
"topics": "inventory.customers",
"connection.url": "jdbc:postgresql://postgres:5432/inventory?user=postgresuser&password=postgrespw",
"transforms": "unwrap,route",
"transforms.unwrap.type": "io.debezium.transforms.ExtractNewRecordState",
"transforms.unwrap.drop.tombstones":"false",
View sourceconnector.json
{
"name":"inventory-connector-mssql",
"config":{
"connector.class":"io.debezium.connector.sqlserver.SqlServerConnector",
"database.user":"sa",
"database.dbname":"inventory",
"database.history.kafka.bootstrap.servers":"my-cluster-kafka-bootstrap:9092",
"database.history.kafka.topic":"schema-changes.inventory",
"transforms":"route",
"database.server.name":"mssql1",