https://github.com/choiis/kafka-spring
java spring producer consumer
https://github.com/choiis/kafka-spring
docker docker-compose kafka kafka-ui reactor spring-boot zookeeper
Last synced: about 2 months ago
JSON representation
java spring producer consumer
- Host: GitHub
- URL: https://github.com/choiis/kafka-spring
- Owner: choiis
- Created: 2022-07-19T00:11:21.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2022-10-31T01:09:48.000Z (over 3 years ago)
- Last Synced: 2023-12-19T16:06:23.815Z (over 2 years ago)
- Topics: docker, docker-compose, kafka, kafka-ui, reactor, spring-boot, zookeeper
- Language: Java
- Homepage:
- Size: 129 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kafka-Spring
## reactor-kafka spring boot producer + spring kafka consumer
### Execution
* Execute kafka, zookeeper, kafka-ui, consul with docker
```bash
docker-compose -f docker/docker-compose.yml up -d
```
* Execute spring boot producer and consumer
```bash
./gradlew -p reactor-producer bootRun
```
```bash
./gradlew -p consumer bootRun
```
* You can turn the switch on and off with an API call.
```
curl -i -X GET \
'http://localhost:18080/on'
```
```
curl -i -X GET \
'http://localhost:18080/off'
```
* When I call it from restapi, the consumer works and keeps a log.
```
curl -i -X POST \
-H "Content-Type:application/json" \
-d \
'{
"name":"insung",
"number":10
}' \
'http://localhost:10100/api/producer'
```
### Run all with docker-compose
* build all
```
./gradlew clean build docker
```
* run all with docker-compose
```
docker-compose up -d
```