SlideShare a Scribd company logo
CONFIDENTIAL: FOR INTERNAL USE ONLY © 2023 REDPANDA DATA
© 2023 REDPANDA DATA
A little about me…
2
Dunith Dhanushka
Senior Developer Advocate, Redpanda Data
● Event streaming, real-time analytics,
and stream processing enthusiast
● Frequent blogger, speaker, and an
educator
@dunithd
linkedin.com/in/dunithd
© 2023 REDPANDA DATA
Agenda
1. Use case
2. Transient and non-transient errors - overview
3. Dead letter topics
4. Handling transient and non-transient errors
5. Q & A
3
© 2023 REDPANDA DATA 4
The problem
How not to lose an expensive message?
© 2023 REDPANDA DATA
Use case Processing an expensive message
E-commerce order processing…
5
© 2023 REDPANDA DATA
What could possibly happen here?
6
Possible outcomes
The happy path
● The order will be processed as expected.
● Sunny day scenario.
Otherwise?
● Processing will fail.
© 2023 REDPANDA DATA 7
“Anything that can go
wrong will go wrong,
and at the worst
possible time.”
Murphy’s law
© 2023 REDPANDA DATA
Possible causes for consumer failures
Two types of errors:
1. Transient errors Unpredicted and short-lived errors in software/hardware/network
components.
2. Non-transient errors Errors that persist over time and cannot be easily resolved through
automatic recovery or failover mechanisms.
8
Why order processing would fail?
© 2023 REDPANDA DATA
Transient errors
Temporary errors that occur in computer systems or
networks, typically caused by:
● Temporary disruptions in network connectivity
● Hardware failures
● Software glitches, or other similar factors.
They are recoverable.
Short-lived errors that are recoverable
9
© 2023 REDPANDA DATA
Non-transient errors
Non-transient errors are deterministic and always
fail when consumed, no matter how many times it
is reprocessed.
It will produce the same result after reprocessing,
causing an infinite loop that wastes precious
computational resources.
Not recoverable
10
© 2023 REDPANDA DATA
Businesses don’t want
to lose messages!
Under any circumstances…
11
© 2023 REDPANDA DATA
Handling
consumer failures
12
© 2023 REDPANDA DATA 13
© 2023 REDPANDA DATA
Dead Letter Queue
DLQ
14
A place where you can route failed messages for reprocessing
© 2023 REDPANDA DATA
Dead Letter Queue pattern - overview
15
© 2023 REDPANDA DATA
DLQ in the context of Kafka
There’s no native DLQs in Kafka!
16
● You can appoint a regular Kafka topic as the DLT.
● Typically, one DLT per source topics.
● Usually the DLT topic name follows the pattern:
<source_topic_name>-dlt
© 2023 REDPANDA DATA
Handling
non-transient
errors
17
© 2023 REDPANDA DATA
General pattern
For handling non-transient errors
18
© 2023 REDPANDA DATA
Spring Kafka consumer with Kafka/Redpanda
19
© 2023 REDPANDA DATA
Code samples
https://github.com/redpanda-data-blog/2022-dead-letter-topics
Where to find the code shown in the talk?
20
© 2023 REDPANDA DATA
Handling malformed
payloads
Dealing with rogue messages
21
© 2023 REDPANDA DATA
Malformed message payloads
● Errors in deserializing string/binary encoded messages at the consumer. E.g XML, JSON, Avro,
Protobuf, etc.
● Are usually caught early at the processing pipeline by Deserializers.
● Errors are logged and message is dropped.
22
© 2023 REDPANDA DATA
Deserialization with Spring Kafka consumers
23
© 2023 REDPANDA DATA
We should route the
malformed messages
to the DLT!
24
They can be corrected and reprocessed later…
© 2023 REDPANDA DATA
Routing malformed messages to the DLT
How Spring Kafka uses the ErrorHandlingDeserializer to catch deserialization errors?
25
© 2023 REDPANDA DATA
Routing malformed messages to the DLT
Spring Kafka configurations
26
© 2023 REDPANDA DATA
Handling
validation/consumer
errors
Dealing with business rule violations and consumer failures.
27
© 2023 REDPANDA DATA
Case 1 The message fails the rule validation
For example:
● Missing fields in the payload E.g the customerId is missing in the order.
● Validation failures E.g the amount is negative.
28
Although the deserialization succeeds
© 2023 REDPANDA DATA
Case 2 Consumer encounters an error
Although the message is perfect, it might trigger an error in the consumer’s processing logic, causing
it to fail the processing.
This time, the error is with the consumer.
For example,
● Consumer throws a NPE.
● RuntimeExceptions
The fault in the consumer’s processing logic
29
© 2023 REDPANDA DATA
We should route them
to the DLT as well.
30
They can be corrected and reprocessed later…
© 2023 REDPANDA DATA
Routing them to DLT
Log the exception and continue. Let Spring route the message to the DLT.
31
In Spring Kafka, you can use the DeadLetterPublishingRecoverer class to route failed messages to
the DLT.
Can be configured with a KafkaTemplate.
© 2023 REDPANDA DATA
How to reprocess messages in the DLT?
● Manual recovery with human intervention.
● Add more context before sending a message to the DLT.
● Producer team should own malformed messages and fix them. E.g The producer might be using
an older schema version.
● Notify the producer about the failure.
Some best practices
32
© 2023 REDPANDA DATA
Handling transient
errors
33
© 2023 REDPANDA DATA
Consumer should retry several times
● The recommended way to handle a transient error is to retry multiple times, with fixed or
incremental intervals in between (back off timestamps).
● If all retry attempts fail, you can redirect the message into the DLT and move on.
● Retrying can be implemented synchronously or asynchronously at the consumer side.
34
Transient errors are recoverable at the consumer’s end
© 2023 REDPANDA DATA
Blocking retries
Consumer thread is blocked until the retry completes
35
© 2023 REDPANDA DATA
Case 1 Simple blocking retries
Suspend the consumer thread and reprocessing the failed message without doing calls to
Consumer.poll() during the retries.
36
© 2023 REDPANDA DATA
Drawbacks
● Main consumer thread is blocked.
● Not ideal for high throughput message processing scenarios.
● Waste of computational resources.
37
© 2023 REDPANDA DATA
Non-blocking
retries with
backoff
Consumer thread continues
38
© 2023 REDPANDA DATA
Retry topics
39
© 2023 REDPANDA DATA
Case 2 Non-blocking retry with a single retry topic
and fixed backoff
40
© 2023 REDPANDA DATA
Spring Kafka configuration
41
© 2023 REDPANDA DATA
Case 3 Non-blocking retry with multiple retry
topics and an exponential back off
42
Inspired by Netflix blog on the same.
© 2023 REDPANDA DATA 43
© 2023 REDPANDA DATA
Spring Kafa configuration
44
© 2023 REDPANDA DATA
Summary
Things you can take home…
45
© 2023 REDPANDA DATA
Takeaways
46
● Consumer failure scenarios can be broadly categorized into transient and non-transient errors.
● Malformed payloads, business rule validation failures, and consumer errors are possible causes
for non-transient errors.
● Consumers should detect non-transient errors as early as possible and move them to the DLT
for manual reprocessing.
● Consumers should implement retry strategies to handle transient errors.
● Prefer using asynchronous retrying when the message throughput is high.
● If all retry attempts fail, the message can be moved to the DLT.
© 2023 REDPANDA DATA
Questions?
47
© 2023 REDPANDA DATA 48
Keep learning
Redpanda University
https://university.redpanda.com
Redpanda Docs
https://docs.redpanda.com/
Redpanda Blogs
https://redpanda.com/blog
Redpanda Code
https://github.com/redpanda-data
© 2023 REDPANDA DATA
Thanks for joining!
Let’s keep in touch
49
@redpandadata redpanda-data
redpanda-data hello@redpanda.com

More Related Content

PDF
Disaster Recovery with MirrorMaker 2.0 (Ryanne Dolan, Cloudera) Kafka Summit ...
PPTX
Apache Kafka at LinkedIn
PDF
Running Kafka as a Native Binary Using GraalVM with Ozan Günalp
PPTX
Deep Dive into Apache Kafka
PPTX
Autoscaling Flink with Reactive Mode
PDF
Introducing the Apache Flink Kubernetes Operator
PDF
Producer Performance Tuning for Apache Kafka
PDF
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안
Disaster Recovery with MirrorMaker 2.0 (Ryanne Dolan, Cloudera) Kafka Summit ...
Apache Kafka at LinkedIn
Running Kafka as a Native Binary Using GraalVM with Ozan Günalp
Deep Dive into Apache Kafka
Autoscaling Flink with Reactive Mode
Introducing the Apache Flink Kubernetes Operator
Producer Performance Tuning for Apache Kafka
Apache kafka 모니터링을 위한 Metrics 이해 및 최적화 방안

What's hot (20)

PDF
Hello, kafka! (an introduction to apache kafka)
PDF
Storage Capacity Management on Multi-tenant Kafka Cluster with Nurettin Omeroglu
PPTX
Using the New Apache Flink Kubernetes Operator in a Production Deployment
PDF
Apache Kafka Introduction
PDF
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
PDF
Exactly-Once, Again: Adding EOS Support for Kafka Connect Source Connectors w...
PPTX
Apache Kafka
PDF
InfluxDB IOx Tech Talks: The Impossible Dream: Easy-to-Use, Super Fast Softw...
PDF
Apache Kafka Architecture & Fundamentals Explained
PPTX
A visual introduction to Apache Kafka
PPTX
Apache Kafka 0.8 basic training - Verisign
PPTX
Where is my bottleneck? Performance troubleshooting in Flink
PDF
Building a fully managed stream processing platform on Flink at scale for Lin...
PDF
Dual write strategies for microservices
PPTX
Tuning Apache Kafka Connectors for Flink.pptx
PDF
PDF
Kappa vs Lambda Architectures and Technology Comparison
PDF
PDF
Hadoop and Spark
PDF
Fundamentals of Apache Kafka
Hello, kafka! (an introduction to apache kafka)
Storage Capacity Management on Multi-tenant Kafka Cluster with Nurettin Omeroglu
Using the New Apache Flink Kubernetes Operator in a Production Deployment
Apache Kafka Introduction
Introduction to Apache ZooKeeper | Big Data Hadoop Spark Tutorial | CloudxLab
Exactly-Once, Again: Adding EOS Support for Kafka Connect Source Connectors w...
Apache Kafka
InfluxDB IOx Tech Talks: The Impossible Dream: Easy-to-Use, Super Fast Softw...
Apache Kafka Architecture & Fundamentals Explained
A visual introduction to Apache Kafka
Apache Kafka 0.8 basic training - Verisign
Where is my bottleneck? Performance troubleshooting in Flink
Building a fully managed stream processing platform on Flink at scale for Lin...
Dual write strategies for microservices
Tuning Apache Kafka Connectors for Flink.pptx
Kappa vs Lambda Architectures and Technology Comparison
Hadoop and Spark
Fundamentals of Apache Kafka
Ad

Similar to Reliable Message Reprocessing Patterns for Kafka with Dunith Dhanushka (15)

PPTX
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
PDF
Deep dive into Apache Kafka consumption
PDF
Error Handling with Kafka: From Patterns to Code
PDF
Apache Kafka – (Pattern and) Anti-Pattern
PDF
How to fail with serverless
PPTX
Webinar patterns anti patterns
PDF
Troubleshooting Kafka's socket server: from incident to resolution
PPTX
Our journey into scalable player engagement platform
PDF
Error Resilient Design: Building Scalable & Fault-Tolerant Microservices with...
PDF
A Marriage of Lambda and Kappa: Supporting Iterative Development of an Event ...
PPTX
Building real time Data Pipeline using Spark Streaming
PDF
Apache Kafka as Message Queue for your microservices and other occasions
PPTX
Fail safe modeling for cloud services and applications
PDF
Apache Kafka lessons learned @PAYBACK
PPTX
Automation-Engineer-Assessment-A-Case-Study .pptx
Kafka error handling patterns and best practices | Hemant Desale and Aruna Ka...
Deep dive into Apache Kafka consumption
Error Handling with Kafka: From Patterns to Code
Apache Kafka – (Pattern and) Anti-Pattern
How to fail with serverless
Webinar patterns anti patterns
Troubleshooting Kafka's socket server: from incident to resolution
Our journey into scalable player engagement platform
Error Resilient Design: Building Scalable & Fault-Tolerant Microservices with...
A Marriage of Lambda and Kappa: Supporting Iterative Development of an Event ...
Building real time Data Pipeline using Spark Streaming
Apache Kafka as Message Queue for your microservices and other occasions
Fail safe modeling for cloud services and applications
Apache Kafka lessons learned @PAYBACK
Automation-Engineer-Assessment-A-Case-Study .pptx
Ad

More from HostedbyConfluent (20)

PDF
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
PDF
Renaming a Kafka Topic | Kafka Summit London
PDF
Evolution of NRT Data Ingestion Pipeline at Trendyol
PDF
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
PDF
Exactly-once Stream Processing with Arroyo and Kafka
PDF
Fish Plays Pokemon | Kafka Summit London
PDF
Tiered Storage 101 | Kafla Summit London
PDF
Building a Self-Service Stream Processing Portal: How And Why
PDF
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
PDF
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
PDF
Navigating Private Network Connectivity Options for Kafka Clusters
PDF
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
PDF
Explaining How Real-Time GenAI Works in a Noisy Pub
PDF
TL;DR Kafka Metrics | Kafka Summit London
PDF
A Window Into Your Kafka Streams Tasks | KSL
PDF
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
PDF
Data Contracts Management: Schema Registry and Beyond
PDF
Code-First Approach: Crafting Efficient Flink Apps
PDF
Debezium vs. the World: An Overview of the CDC Ecosystem
PDF
Beyond Tiered Storage: Serverless Kafka with No Local Disks
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Renaming a Kafka Topic | Kafka Summit London
Evolution of NRT Data Ingestion Pipeline at Trendyol
Ensuring Kafka Service Resilience: A Dive into Health-Checking Techniques
Exactly-once Stream Processing with Arroyo and Kafka
Fish Plays Pokemon | Kafka Summit London
Tiered Storage 101 | Kafla Summit London
Building a Self-Service Stream Processing Portal: How And Why
From the Trenches: Improving Kafka Connect Source Connector Ingestion from 7 ...
Future with Zero Down-Time: End-to-end Resiliency with Chaos Engineering and ...
Navigating Private Network Connectivity Options for Kafka Clusters
Apache Flink: Building a Company-wide Self-service Streaming Data Platform
Explaining How Real-Time GenAI Works in a Noisy Pub
TL;DR Kafka Metrics | Kafka Summit London
A Window Into Your Kafka Streams Tasks | KSL
Mastering Kafka Producer Configs: A Guide to Optimizing Performance
Data Contracts Management: Schema Registry and Beyond
Code-First Approach: Crafting Efficient Flink Apps
Debezium vs. the World: An Overview of the CDC Ecosystem
Beyond Tiered Storage: Serverless Kafka with No Local Disks

Recently uploaded (20)

PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Empathic Computing: Creating Shared Understanding
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
A Presentation on Artificial Intelligence
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Network Security Unit 5.pdf for BCA BBA.
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PPTX
Machine Learning_overview_presentation.pptx
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Dropbox Q2 2025 Financial Results & Investor Presentation
gpt5_lecture_notes_comprehensive_20250812015547.pdf
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Empathic Computing: Creating Shared Understanding
Chapter 3 Spatial Domain Image Processing.pdf
A Presentation on Artificial Intelligence
Per capita expenditure prediction using model stacking based on satellite ima...
Review of recent advances in non-invasive hemoglobin estimation
Network Security Unit 5.pdf for BCA BBA.
The AUB Centre for AI in Media Proposal.docx
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Machine Learning_overview_presentation.pptx
Reach Out and Touch Someone: Haptics and Empathic Computing
NewMind AI Weekly Chronicles - August'25-Week II
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Building Integrated photovoltaic BIPV_UPV.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...

Reliable Message Reprocessing Patterns for Kafka with Dunith Dhanushka

  • 1. CONFIDENTIAL: FOR INTERNAL USE ONLY © 2023 REDPANDA DATA
  • 2. © 2023 REDPANDA DATA A little about me… 2 Dunith Dhanushka Senior Developer Advocate, Redpanda Data ● Event streaming, real-time analytics, and stream processing enthusiast ● Frequent blogger, speaker, and an educator @dunithd linkedin.com/in/dunithd
  • 3. © 2023 REDPANDA DATA Agenda 1. Use case 2. Transient and non-transient errors - overview 3. Dead letter topics 4. Handling transient and non-transient errors 5. Q & A 3
  • 4. © 2023 REDPANDA DATA 4 The problem How not to lose an expensive message?
  • 5. © 2023 REDPANDA DATA Use case Processing an expensive message E-commerce order processing… 5
  • 6. © 2023 REDPANDA DATA What could possibly happen here? 6 Possible outcomes The happy path ● The order will be processed as expected. ● Sunny day scenario. Otherwise? ● Processing will fail.
  • 7. © 2023 REDPANDA DATA 7 “Anything that can go wrong will go wrong, and at the worst possible time.” Murphy’s law
  • 8. © 2023 REDPANDA DATA Possible causes for consumer failures Two types of errors: 1. Transient errors Unpredicted and short-lived errors in software/hardware/network components. 2. Non-transient errors Errors that persist over time and cannot be easily resolved through automatic recovery or failover mechanisms. 8 Why order processing would fail?
  • 9. © 2023 REDPANDA DATA Transient errors Temporary errors that occur in computer systems or networks, typically caused by: ● Temporary disruptions in network connectivity ● Hardware failures ● Software glitches, or other similar factors. They are recoverable. Short-lived errors that are recoverable 9
  • 10. © 2023 REDPANDA DATA Non-transient errors Non-transient errors are deterministic and always fail when consumed, no matter how many times it is reprocessed. It will produce the same result after reprocessing, causing an infinite loop that wastes precious computational resources. Not recoverable 10
  • 11. © 2023 REDPANDA DATA Businesses don’t want to lose messages! Under any circumstances… 11
  • 12. © 2023 REDPANDA DATA Handling consumer failures 12
  • 13. © 2023 REDPANDA DATA 13
  • 14. © 2023 REDPANDA DATA Dead Letter Queue DLQ 14 A place where you can route failed messages for reprocessing
  • 15. © 2023 REDPANDA DATA Dead Letter Queue pattern - overview 15
  • 16. © 2023 REDPANDA DATA DLQ in the context of Kafka There’s no native DLQs in Kafka! 16 ● You can appoint a regular Kafka topic as the DLT. ● Typically, one DLT per source topics. ● Usually the DLT topic name follows the pattern: <source_topic_name>-dlt
  • 17. © 2023 REDPANDA DATA Handling non-transient errors 17
  • 18. © 2023 REDPANDA DATA General pattern For handling non-transient errors 18
  • 19. © 2023 REDPANDA DATA Spring Kafka consumer with Kafka/Redpanda 19
  • 20. © 2023 REDPANDA DATA Code samples https://github.com/redpanda-data-blog/2022-dead-letter-topics Where to find the code shown in the talk? 20
  • 21. © 2023 REDPANDA DATA Handling malformed payloads Dealing with rogue messages 21
  • 22. © 2023 REDPANDA DATA Malformed message payloads ● Errors in deserializing string/binary encoded messages at the consumer. E.g XML, JSON, Avro, Protobuf, etc. ● Are usually caught early at the processing pipeline by Deserializers. ● Errors are logged and message is dropped. 22
  • 23. © 2023 REDPANDA DATA Deserialization with Spring Kafka consumers 23
  • 24. © 2023 REDPANDA DATA We should route the malformed messages to the DLT! 24 They can be corrected and reprocessed later…
  • 25. © 2023 REDPANDA DATA Routing malformed messages to the DLT How Spring Kafka uses the ErrorHandlingDeserializer to catch deserialization errors? 25
  • 26. © 2023 REDPANDA DATA Routing malformed messages to the DLT Spring Kafka configurations 26
  • 27. © 2023 REDPANDA DATA Handling validation/consumer errors Dealing with business rule violations and consumer failures. 27
  • 28. © 2023 REDPANDA DATA Case 1 The message fails the rule validation For example: ● Missing fields in the payload E.g the customerId is missing in the order. ● Validation failures E.g the amount is negative. 28 Although the deserialization succeeds
  • 29. © 2023 REDPANDA DATA Case 2 Consumer encounters an error Although the message is perfect, it might trigger an error in the consumer’s processing logic, causing it to fail the processing. This time, the error is with the consumer. For example, ● Consumer throws a NPE. ● RuntimeExceptions The fault in the consumer’s processing logic 29
  • 30. © 2023 REDPANDA DATA We should route them to the DLT as well. 30 They can be corrected and reprocessed later…
  • 31. © 2023 REDPANDA DATA Routing them to DLT Log the exception and continue. Let Spring route the message to the DLT. 31 In Spring Kafka, you can use the DeadLetterPublishingRecoverer class to route failed messages to the DLT. Can be configured with a KafkaTemplate.
  • 32. © 2023 REDPANDA DATA How to reprocess messages in the DLT? ● Manual recovery with human intervention. ● Add more context before sending a message to the DLT. ● Producer team should own malformed messages and fix them. E.g The producer might be using an older schema version. ● Notify the producer about the failure. Some best practices 32
  • 33. © 2023 REDPANDA DATA Handling transient errors 33
  • 34. © 2023 REDPANDA DATA Consumer should retry several times ● The recommended way to handle a transient error is to retry multiple times, with fixed or incremental intervals in between (back off timestamps). ● If all retry attempts fail, you can redirect the message into the DLT and move on. ● Retrying can be implemented synchronously or asynchronously at the consumer side. 34 Transient errors are recoverable at the consumer’s end
  • 35. © 2023 REDPANDA DATA Blocking retries Consumer thread is blocked until the retry completes 35
  • 36. © 2023 REDPANDA DATA Case 1 Simple blocking retries Suspend the consumer thread and reprocessing the failed message without doing calls to Consumer.poll() during the retries. 36
  • 37. © 2023 REDPANDA DATA Drawbacks ● Main consumer thread is blocked. ● Not ideal for high throughput message processing scenarios. ● Waste of computational resources. 37
  • 38. © 2023 REDPANDA DATA Non-blocking retries with backoff Consumer thread continues 38
  • 39. © 2023 REDPANDA DATA Retry topics 39
  • 40. © 2023 REDPANDA DATA Case 2 Non-blocking retry with a single retry topic and fixed backoff 40
  • 41. © 2023 REDPANDA DATA Spring Kafka configuration 41
  • 42. © 2023 REDPANDA DATA Case 3 Non-blocking retry with multiple retry topics and an exponential back off 42 Inspired by Netflix blog on the same.
  • 43. © 2023 REDPANDA DATA 43
  • 44. © 2023 REDPANDA DATA Spring Kafa configuration 44
  • 45. © 2023 REDPANDA DATA Summary Things you can take home… 45
  • 46. © 2023 REDPANDA DATA Takeaways 46 ● Consumer failure scenarios can be broadly categorized into transient and non-transient errors. ● Malformed payloads, business rule validation failures, and consumer errors are possible causes for non-transient errors. ● Consumers should detect non-transient errors as early as possible and move them to the DLT for manual reprocessing. ● Consumers should implement retry strategies to handle transient errors. ● Prefer using asynchronous retrying when the message throughput is high. ● If all retry attempts fail, the message can be moved to the DLT.
  • 47. © 2023 REDPANDA DATA Questions? 47
  • 48. © 2023 REDPANDA DATA 48 Keep learning Redpanda University https://university.redpanda.com Redpanda Docs https://docs.redpanda.com/ Redpanda Blogs https://redpanda.com/blog Redpanda Code https://github.com/redpanda-data
  • 49. © 2023 REDPANDA DATA Thanks for joining! Let’s keep in touch 49 @redpandadata redpanda-data redpanda-data hello@redpanda.com