Interface GatewayClient
- All Superinterfaces:
AutoCloseable, Monitored<List<SerializedMessage>>
- All Known Implementing Classes:
LocalEventStoreClient, LocalSchedulingClient, LocalTrackingClient, WebsocketGatewayClient
Low-level interface for sending
SerializedMessages to a gateway (e.g. commands, events, queries).
This interface is primarily used internally within the Fluxzero Java SDK and its Runtime transport layers. It defines the mechanics for appending serialized messages to a backing system such as the Fluxzero Runtime or an in-memory store.
Note: End users typically do not interact with this interface directly. Instead, they should rely on the higher-level gateways such as:
or more conveniently, dispatch messages using the static utility methods provided byFluxzero,
such as:
Fluxzero.sendCommandAndWait(new MyCommand());
Fluxzero.publishEvent(new SomethingHappened());
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionappend(Guarantee guarantee, SerializedMessage... messages) Append the given messages to the gateway, applying the given deliveryGuarantee.voidclose()Closes this gateway client, releasing any associated resources (e.g. network connections or background tasks).setRetentionTime(Duration duration, Guarantee guarantee) Set a new retention duration for the underlying gateway's message log.Methods inherited from interface Monitored
registerMonitor
-
Method Details
-
append
Append the given messages to the gateway, applying the given deliveryGuarantee.- Parameters:
guarantee- the delivery guarantee that should be respected (e.g. at-most-once, at-least-once)messages- one or more serialized messages to append- Returns:
- a
CompletableFuturethat completes when the append operation is successful or fails if delivery fails
-
setRetentionTime
Set a new retention duration for the underlying gateway's message log.The retention setting determines how long messages in this log are retained by the system, after which they may be evicted or deleted depending on the platform policy.
- Parameters:
duration- the new retention durationguarantee- the delivery guarantee to apply to the update operation- Returns:
- a
CompletableFuturethat completes once the retention setting is updated
-
close
void close()Closes this gateway client, releasing any associated resources (e.g. network connections or background tasks).- Specified by:
closein interfaceAutoCloseable
-