Skip to content

Dynamic dead-lettering

The error log is durable and replayable, which means you can treat it as a powerful, dynamic DLQ.

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.


In Fluxzero, routing is used to assign messages to segments using consistent hashing. This ensures that messages about the same entity — for example, all events for a given OrderId — are always handled by the same consumer, in the correct order.

This is critical when you’re handling messages in parallel, but still want to ensure per-entity consistency.

By default, the routing key is derived from the message ID. But you can override this by annotating a field, getter, or method in your payload class with @RoutingKey.

public record ShipOrder(@RoutingKey OrderId orderId) {
}
@RoutingKey("customer/id")
public record OrderPlaced(Customer customer) {
}

This instructs Fluxzero to extract customer.id and use it as the routing key when publishing or consuming the message.

In advanced cases, you may want to override routing at the handler level, regardless of how the message was published.

@HandleEvent
@RoutingKey("organisationId")
void handle(OrganisationUpdate event) {
// Will route based on organisationId in metadata or payload
}
@Consumer(ignoreSegment = true)
public class OrganisationHandler {
...
}

You can also extract routing keys from message metadata. If the metadata key is missing, Fluxzero falls back to the payload.

@RoutingKey("userId")
public class AuditLogEntry {
...
}
PlacementMeaning
Field/getterUse the property’s value as routing key
Class-levelUse the named property in metadata or payload
Handler methodOverrides routing key used during handling (requires ignoreSegment)

© 2026 Fluxzero