This project is a example implementation of a CDC for SQLServer using Kafka Connect and MongoDB as sink.
It's structured using Docker containers and docker-compose orquestrator tool.
The base docker image used to create the Kafka cluster and related systems is landoop/fast-data-dev (https://github.com/lensesio/fast-data-dev). It creates the Kafka Broker, Zookeeper, Schema Registry, REST Proxy and Kafka Connect Distributed.
The MSSql Server Source connector used is from Debezium (https://debezium.io/). The MongoDB Sink is from MongoDB (https://docs.mongodb.com/kafka-connector/current/).
- [docker-compose] (https://docs.docker.com/compose/install/)
- [docker] (https://docs.docker.com/get-docker/)
- [Landoop] UI (http://localhost:3030)
- [Kafka Schema Registry] (http://localhost:8081)
- [Kafka REST] (http://localhost:8082)
- [Kafka Connect] (http://localhost:8083)
- [Kafka Broker]
- [MongoDB]
- [SQLServer]
- [MongoDB] (http://localhost:8011)
- SQLServer
docker-compose -f docker-compose.yml exec sqlserver bash -c '/opt/mssql-tools/bin/sqlcmd -U sa -P $MSSQL_SA_PASSWORD -d kafkaconnect'
cd kafka-connect-cdc-example && ./run.sh
docker-compose -f docker-compose.yml exec sqlserver bash -c '/opt/mssql-tools/bin/sqlcmd -U sa -P $MSSQL_SA_PASSWORD -Q "select * from kafkaconnect.dbo.teste"'
docker-compose -f docker-compose.yml exec sqlserver bash -c \
'/opt/mssql-tools/bin/sqlcmd -U sa -P $MSSQL_SA_PASSWORD -Q "insert into kafkaconnect.dbo.teste(numero, numerogrande, dinheiro, decimo, numeral) values (1,2,3,4,5)"'
[Mongo DB Kafka] (https://github.com/mongodb/mongo-kafka)
Free to use and change for your own purposes.