This project assumes you have the following installed on your machine:
- Gradle
- Docker
- Docker-compose
- Postman
Using:
- Spring boot & Flyway -- app framework & DB migration
- Postgresql 11 -- database
- Debezium Kafka Connect & Postgresql connector -- debezium wrapped kafka connect
- Zookeeper
- Kafka -- event store
This project uses pgoutput
as the logical decoding output plugin.
This project also uses the type
column in outbox
table to route message into different topic.
E.g:
Type 'TodoCreatedEvent' will get published to 'sampleproject.todos.todo-created-event'
Type 'TodoDeletedEvent' will get published to 'sampleproject.todos.todo-deleted-event'
Routing is done with groovy expression. This project uses an image with groovy-jsr223 added to classpath as the base image.
https://hub.docker.com/r/fernandochristyanto/debezium-connect-base
- Set up a static ip on local machine
sudo ifconfig lo0 alias 192.168.99.3
- Change directory to todo-service and run
./gradlew clean build
- In root directory, run
docker-compose up
- Import the postman collection
- Hit the
Connector Registration
POST endpoint - Start doing transactions by inserting / deleting todos