Skip to content

redpanda-data-blog/2022-dead-letter-topics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Reliable Message Reprocessing with Dead Letter Topics

How to run this sample?

Start Redpanda

Start a single node Redpanda cluster with Docker Compose by running:

docker compose up -d

Run Java applications

You can find the Spring Boot Kafka client application inside spring-kafka-example directory. Run the main class is com.redpanda.samples.springkafka.Application. It will create the orders topic in Redpanda upon startup.

Produce different messages into the orders topic

Send a perfect JSON message:

docker exec -it redpanda rpk topic produce orders
{ "id":2, "amount":65.49}

This will log the message payload in the Spring application console.

Send a malformed JSON message:

docker exec -it redpanda rpk topic produce orders
{ "id":3, "amount":99.99

This will be routed to the orders-dlt topic, which is the dead letter topic in this scenario.

Simulate a transient error by sending an order with id set to 1. This will be retried in the orders-retry topic.

docker exec -it redpanda rpk topic produce orders
{ "id":1, "amount":12.49}

Cleaning up

docker compose down

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages