Skip to content

Custom message logs

Fluxzero supports custom message logs in addition to built-in ones like commands, events, and queries.

Most applications won’t need them — but they’re powerful for advanced use cases like:

  • Tracking external systems or integrations without cluttering your main event log
  • Publishing low-frequency control signals or batched updates for downstream consumers
  • Isolating workflows with different delivery or retention guarantees

Fluxzero lets you define and handle custom messages by assigning them to user-defined topics. Each topic has its own durable log and behaves just like a native command/event/query log.


To receive messages from a custom log, annotate your handler with @HandleCustom and specify the topic name.

@HandleCustom("metering-points")
void on(MeteringPoint event) {
log.info("Metering point: {}", event);
}

Custom handlers support everything native handlers do:

  • Stateless or @Stateful
  • Optional results if it’s a request
  • Use of custom consumers
  • Segment routing and metadata access
  • Full delivery tracking

You can publish messages directly to a custom topic using the customGateway(...) API.

Fluxzero.get()
.customGateway("third-party-events")
.sendAndForget(new AuditEntry("User login"));

This gives you full control to emit messages that won’t show up in the main event log — ideal for isolating workflows, logs, or side effects.


Each log (including custom ones) can have its own retention policy. By default, messages are retained according to the global retention settings — but you can override this per topic.

Fluxzero.get()
.customGateway("third-party-events")
.setRetentionTime(Duration.ofDays(90));

© 2026 Fluxzero