Reference / template for a Kafka producer-consumer mechanism.
See also:
cd ../kafka-producer-blueprint
./gradlew clean buildcd ../kafka-consumer-blueprint
./gradlew clean buildcd ../kafka-api-blueprint
./gradlew clean builddocker-compose up --builddocker-compose exec kafka kafka-topics.sh --create --topic another-test-topic --bootstrap-server kafka:9092 --partitions 1 --replication-factor 1docker-compose exec kafka kafka-topics.sh --list --bootstrap-server kafka:9092-
Use Postman or a browser to access the API endpoint:
http://localhost:8083/publish?message=HelloKafka -
The message will be forwarded to the producer application, which will then publish it to Kafka.
docker-compose downdocker-compose down -v --rmi all- Official Gradle documentation
- Spring Boot Gradle Plugin Reference Guide
- Spring Configuration Processor
- Spring Boot DevTools
- Spring Integration
- Spring for Apache Kafka
These additional references should also help you: