Giter Club home page Giter Club logo

debezium-mongodb-starter's Introduction

Debezium connector for MongoDB

Debezium’s MongoDB connector tracks a MongoDB replica set or a MongoDB sharded cluster for document changes in databases and collections, recording those changes as events in Kafka topics. The connector automatically handles the addition or removal of shards in a sharded cluster, changes in membership of each replica set, elections within each replica set, and awaiting the resolution of communications problems.

How to start

You can run docker-compose with register.sh file.The file use docker-compose-mongodb.yaml and register-mongodb.json files.

cd debezium-mongodb-starter/
./register.sh

Insert document to MongoDB and Test Scenario

You can run commands with docker-compose-mongodb.yaml for insert sample document to mongodb container:

cd debezium-mongodb-starter/

docker-compose -f docker-compose-mongodb.yaml exec mongodb bash -c 'mongo -u debezium -p dbz --authenticationDatabase admin inventory'

After that, you can execute insert query with Immediate CLI.

db.customers.insert([
    { _id : NumberLong("1006"), first_name : 'Kenan', last_name : 'Başdemir', email : 'test@', unique_id : UUID() }
]);

Shut down the cluster

docker-compose -f docker-compose-mongodb.yaml down

How to monitor Kafka

You can access from http://localhost:9000/ web address to web interface.

I used kafdrop for monitoring tool (see: github.com/obsidiandynamics/kafdrop)


How to consume Debezium

You can run sample .Net Core Consumer Project.

cd KafkaConsumerWorker/
dotnet run

To see examples of consumers written in various languages, refer to the specific language sections. For additional examples, including usage of Confluent Cloud, refer to Code Examples for Apache Kafka®.


Port Table

Container Ports Description / Link
zookeeper 2181, 2888, 3888 zookeeper.apache.org/
kafka 9092, 9094 kafka.apache.org/
mongodb 27017 docs.mongodb.com/
connect 8083 kafka.apache.org/documentation.html#connect
kafdrop 9000 github.com/obsidiandynamics/kafdrop#readme

References / Links

debezium.io/documentation/reference/connectors/mongodb.html

docs.confluent.io/platform/current/tutorials/examples/clients/docs/clients-all-examples.html#clients-all-examples

License

MIT

Authors

debezium-mongodb-starter's People

Contributors

kenanbasdemir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.