Change Data Capture with Debezium and Kafka based on Docker
- Clone this repository anywhere on your machine:
$ git clone https://github.com/snlangsuan/demo-cdc-debezium-kafka.git
- Run docker compose build
$ docker-compose up -d
- Access to MariaDB
$ docker-compose -f docker-compose.yml exec mariadb \
bash -c 'mysql -uroot -p$MYSQL_ROOT_PASSWORD inventory'
- Register a connector to monitor the database
$ curl -i -X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d @register-mysql.json \
http://localhost:8083/connectors
- Display list of connectors
$ curl http://localhost:8083/connectors
- Get a connector by name
$ curl http://localhost:8083/connectors/inventory-connector
- Delete a connector by name
$ curl -X DELETE http://localhost:8083/connectors/inventory-connector
- Get a list of topics
$ docker-compose run --rm kafka list-topics
- Watch topic by topic name
$ docker-compose run --rm kafka watch-topic \
-a -k 'dbserver1.inventory.customers'