Package app.l2nx.gs.adapter.core.events
Class EventsBootstrap
java.lang.Object
app.l2nx.gs.adapter.core.events.EventsBootstrap
Public factory for the events publish subsystem.
NxAdapter calls
start(Map, EventsPublisher.Sender, EventsConfig) once per connect
cycle to wire up the bounded queue + daemon thread + registry, returning a
EventsBootstrap.Started bundle with the EventsPublisher (for shutdown +
heartbeat status) and the NxEvents façade (for
ConnectContext.events()).
Hides EventTypeRegistry and NxEventsImpl — those are
package-private implementation details. Callers depend only on the public
NxEvents interface and the EventsPublisher class.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classTuple of the wired-up publisher and itsNxEventsfaçade. -
Method Summary
Modifier and TypeMethodDescriptionstatic EventsBootstrap.Startedstart(@Nullable Map<String, String> familyTopics, EventsPublisher.Sender sender, EventsConfig config) Materializes the registry, instantiates the publisher, starts its daemon thread, and wraps the publisher in anNxEventsfaçade.static EventsPublisherswap(app.l2nx.gs.adapter.api.spi.NxEvents facade, @Nullable Map<String, String> familyTopics, EventsPublisher.Sender sender, EventsConfig config) Rebuild the publisher in-place behind a stableNxEventsfaçade.
-
Method Details
-
start
public static EventsBootstrap.Started start(@Nullable Map<String, String> familyTopics, EventsPublisher.Sender sender, EventsConfig config) Materializes the registry, instantiates the publisher, starts its daemon thread, and wraps the publisher in anNxEventsfaçade.- Parameters:
familyTopics- per-family Kafka topic map fromMessagingTopics.events;nullor empty disables every publish call (no-op + DEBUG log).sender- Kafka send bridge — production wires this toNxKafka.instance()::sendBytesKeyRecord.config- operator-tunable knobs (queue capacity, drop policy, shutdown drain).
-
swap
public static EventsPublisher swap(app.l2nx.gs.adapter.api.spi.NxEvents facade, @Nullable Map<String, String> familyTopics, EventsPublisher.Sender sender, EventsConfig config) Rebuild the publisher in-place behind a stableNxEventsfaçade. Used on reconnect — modules that capturedctx.events()from an earlieronConnectkeep publishing into the new publisher with no re-registration.
-