Interface GatewayClient
- All Superinterfaces:
AutoCloseable
,Monitored<List<SerializedMessage>>
- All Known Implementing Classes:
LocalEventStoreClient
,LocalSchedulingClient
,LocalTrackingClient
,WebsocketGatewayClient
Low-level interface for sending
SerializedMessage
s to a gateway (e.g. commands, events, queries).
This interface is primarily used internally within the Flux Capacitor client and its platform transport layers. It defines the mechanics for appending serialized messages to a backing system such as the Flux platform 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 byFluxCapacitor
,
such as:
FluxCapacitor.sendCommandAndWait(new MyCommand()); FluxCapacitor.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
.void
close()
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 io.fluxcapacitor.common.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
CompletableFuture
that 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
CompletableFuture
that 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:
close
in interfaceAutoCloseable
-