The Real Fullstack

The Poison Message

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

Engenheiro7 minSimulador de linha do tempoDesafio de código
kafkaspring-kafkarabbitmqjava

Este desafio ainda não foi traduzido para Português (Brasil). Você está lendo a versão em inglês.

Missão:Keep the stream flowing: no blocked partition, no silently lost messages, and no valid message dead-lettered because of a transient error.Contexto · Objetivos de aprendizagem ▾

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.

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

Objetivos de aprendizagem

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

Execute a simulação para ver a saída.

Executar simulação
@BeanDefaultErrorHandler errorHandler() {  return new DefaultErrorHandler(new FixedBackOff(1000L, FixedBackOff.UNLIMITED_ATTEMPTS)); // poison pill blocks the partition}

Simplificação

Three messages: valid, malformed (permanent failure), valid with a database timeout (transient failure). Modelo educacional — os números ilustram comportamento, não são benchmarks.

Conceitos

Desafios relacionados

Referências