Start Zookeeper, Kafka, PostgreSQL, and Kafka Connect:
docker compose up
In another terminal, run the Quarkus application in /chapter-9/debezium:
mvn clean package
java -jar target/quarkus-app/quarkus-run.jar
curl -i -X POST -H "Accept:application/json" -H "Content-Type:application/json" http://localhost:8083/connectors/ -d @register.json
curl -H "Accept:application/json" localhost:8083/connectors/
curl -X GET -H "Accept:application/json" localhost:8083/connectors/customer-connector
docker exec -ti kafka bin/kafka-topics.sh --list --zookeeper zookeeper:2181
docker-compose exec kafka /kafka/bin/kafka-console-consumer.sh \
--bootstrap-server kafka:9092 \
--from-beginning \
--property print.key=true \
--topic quarkus-db-server.public.customer
Upon starting, four messages will be processed representing the four customers that were loaded
by the Quarkus application upon starting.
If you don't want to see those messages,
remove --from-beginning
in the above command.
In another terminal, create or update customer data to see the messages appear.
curl -X PUT -H "Content-Type:application/json" http://localhost:8080/customer/2 -d '{"id" : 2, "name" : "Marsha Willis"}'
curl -X POST -H "Content-Type:application/json" http://localhost:8080/customer -d '{"name" : "Harry Houdini"}'
When finished, run the below to stop and remove the services:
docker compose stop
docker compose rm