Skip to content

F9Uf/learn-debezium

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Learn DEBEZIUM

Create a new Debezium connector

  • list all connections
    curl --location 'http://localhost:8083/connectors/'
  • create a new connector
    curl --location 'http://localhost:8083/connectors' \
    --header 'Content-Type: application/json' \
    --data '{
      "name": "employee-connector-alpha",
      "config": {
        "connector.class": "io.debezium.connector.mongodb.MongoDbConnector",
        "mongodb.connection.string": "mongodb://mongo:27017/?replicaSet=rs0",
        "topic.prefix": "alpha",
        "database.include.list": "company",
        "collection.include.list": "company.employees"
      }
    }'
  • get a connector status
    curl --location 'http://localhost:8083/connectors/employee-connector-alpha'

Update data in MongoDB

  • connect to MongoDB
    docker exec -it lean-debezium-mongo-1 mongosh
  • use the database
    use company
  • insert new document
    db.employees.insert({
      "name": "Patricia Lebsack",
      "username": "Karianne",
      "email": "Julianne.OConner@kory.org",
      "address": {
        "street": "Hoeger Mall",
        "suite": "Apt. 692",
        "city": "South Elvis",
        "zipcode": "53919-4257",
        "geo": {
          "lat": "29.4572",
          "lng": "-164.2990"
        }
      },
      "phone": "493-170-9623 x156"
    })
  • update existing document
    db.employees.update(
      { "username": "Bret" },
      { $set: { "phone": "" } }
    )
  • delete existing document
    db.employees.deleteOne({ "username": "Antonette" })

About

example debezium connector with MongoDB

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published