It's a project demonstrating how to integrate Kafka framework into Java Spring project. Notable characteristics of this setup:
- Annotation-driven to minimize boilerplate code
- Integration tests rely on locally launched Kafka dependencies to enable testability of beans
- Example object is transferred using JSON serialization/deserialization
- JDK 11 installed
- Kafka brokers and zookeeper launched either from install location or as docker containers
To start Kafka docker-compose.yml
file can be reused for convenience if docker is installed, use this command in terminal:
docker-compose up -d
To run Spring app and observe how producer and consumer is working run the app with the following terminal command:
./gradlew run
To launch integration test suite, use this command:
./gradlew integrationTest
For demo purposes it's enough to invoke this REST endpoint:
curl --request POST \
--url http://localhost:8080/payment/deposit/send