Event-Driven

Poison Message Pattern

Description

Handling a message that consistently causes a consumer to crash or fail. The solution is usually to detect this and move it to a DLQ.

Where to use

  • Stability of consumers.

Real World Example

A malformed JSON packet causes the parser to throw an unhandled exception. The consumer catches this, marks it 'Poison', and discards it.

Code Example

class PoisonMessagePattern:\n    def __init__(self):\n        pass\n\n    def execute(self):\n        print('Executing Poison Message Pattern')