https://github.com/bitxon/java-spring-kafka
https://github.com/bitxon/java-spring-kafka
java kafka spring
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bitxon/java-spring-kafka
- Owner: bitxon
- Created: 2024-01-24T22:40:28.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-26T10:49:34.000Z (9 months ago)
- Last Synced: 2025-01-26T11:26:18.514Z (9 months ago)
- Topics: java, kafka, spring
- Language: Java
- Homepage:
- Size: 121 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Java Spring Kafka
This is a playground for Spring & Kafka
---
## Kafka: Single Pojo Processing
### Description
- `OrderListener` simulates long-running operation - 2000millis for one message, but topic has 3 partitions and listener has `concurrency = "3"` so we parallelize processing.
- `PaymentListener` simulates failure using custom exceptions Retryable and Non-Retryable
### Run
```shell
docker compose up -d
```
```shell
./gradlew kafka-single-pojo:bootRun
```
---
## Kafka: Single Pojo Processing | Reply Topic + DLQ Topic
### Description
- `InvoiceForwardingListener` forward message from `invoice-request` to `invoice-response` but in case of error to `invoice-dlq`
### Run
```shell
docker compose up -d
```
```shell
./gradlew kafka-single-pojo-reply-or-dlq:bootRun
```
---
## Kafka: Batch Pojo (v1) Processing
### Description
- `ShipmentBatchListener` simulates failure using custom exceptions Retryable and Non-Retryable in **Batch**
### Run
```shell
docker compose up -d
```
```shell
./gradlew kafka-batch-pojo:bootRun
```
---
## Kafka: Batch Pojo (v2) Processing
This module has the same logic as v1 but configuration is done without Spring auto-configurations
### Description
- `ShipmentBatchListener` simulates failure using custom exceptions Retryable and Non-Retryable in **Batch**
### Run
```shell
docker compose up -d
```
```shell
./gradlew kafka-batch-pojo-v2:bootRun
```
---
## Test
[Open Kafka-UI](http://localhost:9000)