The Real Fullstack

The Poison Message

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

Ingénieur7 minSimulateur de chronologieDéfi de code
kafkaspring-kafkarabbitmqjava

Ce défi n'est pas encore traduit en Français. Vous lisez la version anglaise.

Mission:Keep the stream flowing: no blocked partition, no silently lost messages, and no valid message dead-lettered because of a transient error.Contexte · Objectifs d'apprentissage ▾

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.

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

Objectifs d'apprentissage

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

Lancez la simulation pour voir la sortie.

Lancer la simulation
@BeanDefaultErrorHandler errorHandler() {  return new DefaultErrorHandler(new FixedBackOff(1000L, FixedBackOff.UNLIMITED_ATTEMPTS)); // poison pill blocks the partition}

Simplification

Three messages: valid, malformed (permanent failure), valid with a database timeout (transient failure). Modèle pédagogique — les chiffres illustrent un comportement, ce ne sont pas des benchmarks.

Concepts

Défis liés

Références