The Real Fullstack

The Poison Message

Only one message is broken. Why have 950 valid orders been waiting for an hour?

工程师7 分钟时间线模拟器代码挑战
kafkaspring-kafkarabbitmqjava

此挑战尚未翻译为简体中文,你正在阅读英文版本。

任务:Keep the stream flowing: no blocked partition, no silently lost messages, and no valid message dead-lettered because of a transient error.背景 · 学习目标 ▾

Larkspur's order consumer retries failed messages forever with a fixed delay. A partner sent one malformed payload. The consumer has been retrying it ever since, and Kafka lag on that partition keeps growing.

任务: Keep the stream flowing: no blocked partition, no silently lost messages, and no valid message dead-lettered because of a transient error.

学习目标

  • Distinguish permanent from transient failures.
  • Use bounded retries with backoff and a dead-letter topic.
  • Avoid “skip and log” data loss.
模拟模拟数据

运行模拟以查看输出。

运行模拟
@BeanDefaultErrorHandler errorHandler() {  return new DefaultErrorHandler(new FixedBackOff(1000L, FixedBackOff.UNLIMITED_ATTEMPTS)); // poison pill blocks the partition}

简化说明

Three messages: valid, malformed (permanent failure), valid with a database timeout (transient failure). 教学模型——数字用于说明行为,并非基准测试。

概念

相关挑战

参考资料