- Docker should be installed
- Java 21 should be installed -->
export JAVA_HOME=$(/usr/libexec/java_home -v 21)
Zookeeper
: http://localhost:2181Kafka Nodes
: http://localhost:9092,http://localhost:9093Kafdrop
, a UI tool to visualize topics and messages on: http://localhost:9000PostgreSQL
DB connection detailsUser: postgres
Password: postgres
Database: postgres
Port: 5433
- First way
- Run the following script --> ./scripts/run.sh
- Second way
- Run
docker-compose up -d
command to start the services(OPTIONAL)
- Run
mvn clean install
ormvn clean package
- Run
mvn spring-boot:run
or./mvnw spring-boot:run
- Run
- Third way
- Run the following test --> KafkaDebeziumServiceApplicationTests.java
- Swagger Url: http://localhost:8001/swagger-ui/index.html
- Actuator Url: http://localhost:8001/actuator
-
Connect to
PostgreSQL
with the provided connection details above -
Run the following query to make sure there are records
select * from inventory.customers;
-
Run the following script to update a record
UPDATE inventory.customers SET email = 'sally.thomas.updated@acme.com' WHERE id = 1001;
-
Check Orders Inventory Customers Topic to make sure message is published
For further reference, please consider the following sections:
- Kafka Local
- Run Debezium Kafka Connect using Docker | Kafka | Zookeeper | Kafdrop | Docker Compose
- Debezium connector for PostgreSQL
- Setting Up a Local Kafka Using Testcontainers in Spring Boot
- Posting Request Body with Curl [Curl/Bash Code]