Interface ClusterEventBus

All Known Implementing Classes:
NoOpClusterEventBus, PostgresClusterEventBus

public interface ClusterEventBus
Pluggable SPI for delivering ClusterEvents across the nodes of a horizontally-scaled deployment — the mechanism that keeps live-UI updates in sync when more than one instance runs behind a load balancer.

It is swappable exactly like com.onec.ui.media.MediaStorage: the framework wires a NoOpClusterEventBus when nothing better is available, onec-cluster-starter supplies a Postgres LISTEN/NOTIFY default on a Postgres datasource, and a commercial build can replace either by exposing its own ClusterEventBus bean (e.g. Kafka- or Redis-backed), which the auto-configuration's @ConditionalOnMissingBean default then steps aside for.

This is a best-effort live-UI signal, not a guaranteed-delivery event log. An event dropped during a reconnect is acceptable — the browser re-fetches the affected surface on its next interaction. Durable, exactly-once domain-event distribution is the job of the outbox relay (com.onec.messaging.OutboxWriter + onec-kafka-starter), not this bus.

  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Whether this bus actually crosses node boundaries.
    void
    Publish a change to peer nodes.
    void
    Register a sink invoked for events that originated on other nodes.