Class WebsocketSchedulingClient
java.lang.Object
io.fluxcapacitor.javaclient.common.websocket.AbstractWebsocketClient
io.fluxcapacitor.javaclient.scheduling.client.WebsocketSchedulingClient
- All Implemented Interfaces:
SchedulingClient
,AutoCloseable
WebSocket-based implementation of the
SchedulingClient
interface that communicates with the Flux Platform.
This client is responsible for scheduling, cancelling, and querying deferred messages (schedules) over a WebSocket
connection. It acts as the transport layer for the MessageScheduler
.
Usage is typically indirect via high-level APIs like FluxCapacitor.schedule(...)
or the
MessageScheduler
. Direct interaction with this client is uncommon in most application code.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class io.fluxcapacitor.javaclient.common.websocket.AbstractWebsocketClient
AbstractWebsocketClient.PingRegistration, AbstractWebsocketClient.WebSocketRequest
-
Field Summary
Fields inherited from class io.fluxcapacitor.javaclient.common.websocket.AbstractWebsocketClient
defaultObjectMapper, defaultWebSocketContainer
-
Constructor Summary
ConstructorsConstructorDescriptionWebsocketSchedulingClient
(String endPointUrl, WebSocketClient client) Constructs a scheduling client connected to the given endpoint URL.WebsocketSchedulingClient
(URI endpointUri, WebSocketClient client) Constructs a scheduling client connected to the given endpoint URI.WebsocketSchedulingClient
(URI endpointUri, WebSocketClient client, boolean sendMetrics) Constructs a scheduling client connected to the given endpoint URI with an option to enable or disable metrics tracking. -
Method Summary
Modifier and TypeMethodDescriptioncancelSchedule
(String scheduleId, Guarantee guarantee) Cancel a scheduled message using the provided delivery guarantee.getSchedule
(String scheduleId) Retrieves the serialized schedule associated with the given ID.schedule
(Guarantee guarantee, SerializedSchedule... schedules) Schedule one or more serialized schedules with a specifiedGuarantee
.Methods inherited from class io.fluxcapacitor.javaclient.common.websocket.AbstractWebsocketClient
abort, close, close, handleResult, metricsMetadata, onClose, onError, onMessage, onOpen, onPong, retryOutstandingRequests, schedulePing, send, sendAndWait, sendCommand, sendPing, toString, tryPublishMetrics
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.fluxcapacitor.javaclient.scheduling.client.SchedulingClient
cancelSchedule, close, hasSchedule, schedule
-
Constructor Details
-
WebsocketSchedulingClient
Constructs a scheduling client connected to the given endpoint URL.- Parameters:
endPointUrl
- The endpoint URL of the Flux Platform scheduling gateway.client
- The FluxWebSocketClient
configuration to use.
-
WebsocketSchedulingClient
Constructs a scheduling client connected to the given endpoint URI.- Parameters:
endpointUri
- The URI of the scheduling gateway.client
- The FluxWebSocketClient
configuration to use.
-
WebsocketSchedulingClient
Constructs a scheduling client connected to the given endpoint URI with an option to enable or disable metrics tracking.- Parameters:
endpointUri
- The URI of the scheduling gateway.client
- The WebSocket client configuration.sendMetrics
- Whether to send metrics about schedule operations.
-
-
Method Details
-
schedule
Description copied from interface:SchedulingClient
Schedule one or more serialized schedules with a specifiedGuarantee
.- Specified by:
schedule
in interfaceSchedulingClient
- Parameters:
guarantee
- Delivery guarantee to apply (e.g., none, sent, stored).schedules
- One or more schedules to register.- Returns:
- A future that completes when the scheduling is acknowledged.
-
cancelSchedule
Description copied from interface:SchedulingClient
Cancel a scheduled message using the provided delivery guarantee.- Specified by:
cancelSchedule
in interfaceSchedulingClient
- Parameters:
scheduleId
- The identifier of the schedule to cancel.guarantee
- Delivery guarantee for the cancellation request.- Returns:
- A future that completes when the cancellation is processed.
-
getSchedule
Description copied from interface:SchedulingClient
Retrieves the serialized schedule associated with the given ID.- Specified by:
getSchedule
in interfaceSchedulingClient
- Parameters:
scheduleId
- The ID of the schedule to retrieve.- Returns:
- The matching
SerializedSchedule
, ornull
if none is found.
-