Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dlamott/spring-boot-kafka-consumer
Spring Boot Kafka Consumer example built using Gradle. Showcases error handling, payload consumption, listener creation, junit testing, health endpoint, and more.
https://github.com/dlamott/spring-boot-kafka-consumer
java junit kafka kafka-consumer spring spring-boot
Last synced: 25 days ago
JSON representation
Spring Boot Kafka Consumer example built using Gradle. Showcases error handling, payload consumption, listener creation, junit testing, health endpoint, and more.
- Host: GitHub
- URL: https://github.com/dlamott/spring-boot-kafka-consumer
- Owner: DLaMott
- License: mit
- Created: 2023-05-30T15:19:04.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2023-05-30T18:02:13.000Z (over 1 year ago)
- Last Synced: 2024-11-14T00:35:52.664Z (3 months ago)
- Topics: java, junit, kafka, kafka-consumer, spring, spring-boot
- Language: Java
- Homepage:
- Size: 71.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Spring Boot KafkaConsumer
## Features
* Spring-Boot kafka consumer showcase
* JUnit
* Localstack configuration
* Gradle implementation## Don't want the code?
Use my kafka consumer generator!
*Requires Node/ NPM to be set up*```
> npm install -g yo
> npm install -g generator-spring-boot-kafka-consumer
> yo generator-spring-boot-kafka-consumer
```## Local Development Setup:
***Steps To test Consumer against a Producer***1. **Ensure Kafka is installed on your local machine:**
- *Recommended Installation Guide:* https://hevodata.com/learn/install-kafka-on-windows/2. **Start Kafka!**
- .\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties to start zookeeper
- .\bin\windows\kafka-server-start.bat .\config\server.properties to start kafka server3. **Create Topic**:
- .\bin\windows\kafka-topics.bat --create --bootstrap-server localhost:9092 --replication-factor 1 --partitions 1 --topic test-topic- *View Topics*:
- \.bin\windows\kafka-topics.bat --list --bootstrap-server localhost:90924. **Produce Topic**:
- .\bin\windows\kafka-console-producer -broker-list localhost:9092 -topic test-topic- *Sample Payload*:
- {"data":{"operation":"update","eventKey":"JohnSmith"},"metadata":{"dataClassification":"public","eventDateTime":"2023-12-21T05:05:15.65445Z","eventId":"23434-343-3434-33","topicName":"test-topic", "eventName":"fire-topic", "version":"v1"}}