Giter Site home page Giter Site logo

tana8m / db2-debezium-kafka-connector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pete013/db2-debezium-kafka-connector

0.0 0.0 0.0 33 KB

This is a sample CDC setup using debezium-connector for db2 as source and kafka topic as sink.

Shell 24.89% C 75.11%

db2-debezium-kafka-connector's Introduction

This is a sample CDC setup using debezium-connector for db2 as source and kafka topic as sink.

Commands to follow:

# pre-requisites:
#  - curl
#  - docker

# to create and start the docker container services
export CP_VERSION=5.4.3
docker-compose up --build

# to stop the running docker container services
docker-compose stop

# to start the stopped docker container services
docker-compose start

# to stop and delete the docker container services
docker-compose down

# curl commands to check status of conector
curl -i -X POST -H "Accept: application/json" -H "Content-Type: application/json" http://localhost:8083/connectors -d @db2-connector-source.json
curl -i -X GET -H "Accept: application/json" http://localhost:8083/connectors/db2-connector-source
curl -i -X GET -H "Accept: application/json" http://localhost:8083/connectors/db2-connector-source/status
curl -i -X DELETE -H "Accept: application/json" http://localhost:8083/connectors/db2-connector-source
curl -i -X POST -H "Accept: application/json" http://localhost:8083/connectors/db2-connector-source/tasks/0/restart # can be used to restart failed connector task upon delay in db2 startup

# db2 cli shell command
docker exec -it db2 bash -c "su - db2inst1"

# kafka topic commands
docker exec -it kafkacat kafkacat -b kafka:29092 -t testdb.DB2INST1.ORDERS -C
docker exec -it kafkacat kafkacat -b kafka:29092 -L

kafka-console-consumer --bootstrap-server kafka:29092 --topic testdb.DB2INST1.ORDERS --from-beginning
kafka-topics --zookeeper zookeeper:2181 --list

DB2 ASN CDC possible function calls:

VALUES ASNCDC.ASNCDCSERVICES('start','asncdc'); --ENABLE_DB_CDC
VALUES ASNCDC.ASNCDCSERVICES('stop','asncdc'); --DISABLE_DB_CDC
VALUES ASNCDC.ASNCDCSERVICES('status','asncdc'); --STATUS_DB_CDC
VALUES ASNCDC.ASNCDCSERVICES('reinit','asncdc'); --RESTART_ASN_CDC
CALL ASNCDC.ADDTABLE('DB2INST1', '#'); --ENABLE_TABLE_CDC
CALL ASNCDC.REMOVETABLE('DB2INST1', '#'); --DISABLE_TABLE_CDC
-- '#' -> tableName in UPPERCASE

Reference links:

db2-debezium-kafka-connector's People

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.