Coder Social home page Coder Social logo

mongodb_cdc's Introduction

Reading MongoDB changes and publishing to the Pub/Sub

Change streams allow applications to access data changes without the complexity and risk of tailing the oplog. The program helps to read the changes and then publish the change to Pub/Sub. We read the changes from the mongodb and publish the changes in Pub/Sub. Supervisor is used for process control.

Moving MongDB Changes to PubSub

Install dependencies (src/requirements.txt) and pip3 install -r src/requirements.txt Please pass the following parameters

  • project_id Project Id for the
  • topic Topic where the changes are pushed
  • mongodb MongoDB host (Comma seperated hostname)
  • port MongoDB port
  • collection The name of the collection which changes
  • threshold Number of elements after which the state is persisted on the disk (state file is in the same path where python source is located. Name of state file state_{name_of_collection}_cdc)

Set the service account key path to GOOGLE_APPLICATION_CREDENTIALS in supervisor configuration. Similarly set the other varaibles (<<replace_me>>) in config/supervisord.config

mongodb_cdc's People

Stargazers

Aiman Muhamad avatar

Watchers

James Cloos avatar Bipin Upadhyaya avatar

Forkers

rstar1998

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.