Pick the fix
A consumer fails on a message whose JSON is invalid. Best handling?
Hint 1 of 1
Will a retry change the payload?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Dead-letter it with the error after one or two attempts and keep consuming
Correct. Retries can't fix a malformed payload.
Retries help with temporary failures. A message that can't be parsed will fail the same way every time, so move it aside with its error after one or two tries and let the partition move on.
Why not the others?
- B Retry with backoff forever. It will never succeed and blocks the partition.
- C Skip it silently. Data is lost with no trace.
- D Crash the service to get attention. Restarts hit the same message again.