Skip to content

Dynamic dead-lettering

After fixing a handler bug, you may need to retry just the messages it failed to process. Track the durable error log and use @Trigger to recover the original request. This provides a selective dead-letter recovery flow.

Here’s how:

  1. Deploy a special consumer that tracks the error log.
  2. Use @Trigger to access and inspect failed messages.
  3. Filter and replay failures based on time, payload type, or originating app.

Let’s assume a bug caused command processing to fail in September 2025. The following setup reprocesses those failed commands:

@Consumer(name = "command-dlq",
minIndex = 115126095052800000L,
maxIndexExclusive = 115295964364800000L) // 2025-09-01 to 2025-10-01
class CommandReplayHandler {
@HandleError
void retry(ConsoleError error, @Trigger(messageType = MessageType.COMMAND) MyCommand failedCommand) {
Fluxzero.sendCommand(failedCommand);
}
}
Use caseHow the Error log helps
Fix a bug retroactivelyReplay failed commands from the past
Validate new handler logicTest it against real-world errors
Retry transient failuresRe-issue requests with retry logic
Clean up or suppress errorsFilter out known false-positives

The error log acts as a time-travel debugger — it gives you full control over how and when to address failures, now or in the future.


Retrying publishes the command again, so its normal routing rules apply. Routing controls which tracker processes related messages inside a consumer; it does not make retries idempotent. See custom routing keys.

Payload fields or class-level @RoutingKey select a key from the message. A handler-level override requires ignoreSegment = true on its consumer. The tracking guide and RoutingKey API describe these choices.


© 2026 Fluxzero