Giter VIP home page Giter VIP logo

kafka-debezium-python's Introduction

rob drawio

Steps

Step 1 :

docker-compose up --build up

Step 2 :

  • Login into PG Admin
  • Username: postgres
  • password : postgres
  • database name : postgres

CREATE TABLE sales (
	InvoiceID int NOT NULL ,
	ItemID int NOT NULL,
	Category varchar(255),
	Price decimal ,
	Quantity int not NULL,
	OrderDate timestamp,
	DestinationState varchar(2),
	ShippingType varchar(255),
	Referral varchar(255),
	PRIMARY KEY (InvoiceID)

)

ALTER TABLE public.sales REPLICA IDENTITY  FULL

Step 3:

  • Create Debezium connector
curl --location --request POST 'http://localhost:8083/connectors/' \
--header 'Content-Type: application/json' \
--data-raw '{
  "name": "sales-connector",
  "config": {
    "connector.class": "io.debezium.connector.postgresql.PostgresConnector",
    "plugin.name": "pgoutput",
    "database.hostname": "postgres",
    "database.port": "5432",
    "database.user": "postgres",
    "database.password": "postgres",
    "database.dbname": "postgres",
    "database.server.name": "postgres",
    "table.include.list": "public.sales"
  }
}'
  • Verify
http://localhost:8083/connectors/sales-connector

Step 4:

cd kafka-code
python python-producer-posgres.py

python 

Step 5:

  • in case if you want to see logs into docker exec in container
docker networks ls 
COPY THE NAME 

docker run --tty --network <COPY NAME>  confluentinc/cp-kafkacat kafkacat -b kafka:29092 -C -s key=s -s value=avro -r http://schema-registry:8081 -t postgres.public.sales

Happy Learning

Note

kafka-debezium-python's People

Contributors

soumilshah1995 avatar

Stargazers

 avatar  avatar

Watchers

 avatar  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.