Class WebSocketClient
java.lang.Object
io.fluxcapacitor.javaclient.configuration.client.AbstractClient
io.fluxcapacitor.javaclient.configuration.client.WebSocketClient
- All Implemented Interfaces:
Client
A
Client
implementation that connects to the Flux Platform using WebSocket connections.
This client enables full integration with the Flux runtime by delegating all gateway, tracking, and subsystem
communication to remote endpoints defined by the WebSocketClient.ClientConfig
. It is typically used in production and testing
environments where communication with the Flux backend is required.
Usage
WebSocketClient client = WebSocketClient.newInstance(
WebSocketClient.ClientConfig.builder()
.serviceBaseUrl("wss://my.flux.host")
.name("my-service")
.build());
FluxCapacitor flux = FluxCapacitor.builder().build(client);
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Configuration class for creating aWebSocketClient
.static class
Configuration for a tracking client assigned to a specificMessageType
. -
Field Summary
Fields inherited from class io.fluxcapacitor.javaclient.configuration.client.AbstractClient
shutdownTasks
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the application ID under which this client instance is registered.protected EventStoreClient
Subclasses must implement this method to return aEventStoreClient
.protected GatewayClient
createGatewayClient
(MessageType messageType, String topic) Subclasses must implement this method to return aGatewayClient
for the given message type and topic.protected KeyValueClient
Subclasses must implement this method to return aKeyValueClient
.protected SchedulingClient
Subclasses must implement this method to return aSchedulingClient
.protected SearchClient
Subclasses must implement this method to return aSearchClient
.protected TrackingClient
createTrackingClient
(MessageType messageType, String topic) Subclasses must implement this method to return aTrackingClient
for the given message type and topic.id()
Returns the unique identifier of this client instance.name()
Returns the name of this client as defined in its configuration.static WebSocketClient
newInstance
(WebSocketClient.ClientConfig clientConfig) void
shutDown()
Shuts down this client instance, releasing any underlying resources.Methods inherited from class io.fluxcapacitor.javaclient.configuration.client.AbstractClient
beforeShutdown, getGatewayClient, getTrackingClient, monitorDispatch
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.fluxcapacitor.javaclient.configuration.client.Client
getEventStoreClient, getGatewayClient, getKeyValueClient, getSchedulingClient, getSearchClient, getTrackingClient, unwrap
-
Constructor Details
-
WebSocketClient
public WebSocketClient()
-
-
Method Details
-
newInstance
-
name
Description copied from interface:Client
Returns the name of this client as defined in its configuration. -
id
Description copied from interface:Client
Returns the unique identifier of this client instance. This id may be randomly generated. -
applicationId
Description copied from interface:Client
Returns the application ID under which this client instance is registered. -
createGatewayClient
Description copied from class:AbstractClient
Subclasses must implement this method to return aGatewayClient
for the given message type and topic.- Specified by:
createGatewayClient
in classAbstractClient
-
createTrackingClient
Description copied from class:AbstractClient
Subclasses must implement this method to return aTrackingClient
for the given message type and topic.- Specified by:
createTrackingClient
in classAbstractClient
-
createEventStoreClient
Description copied from class:AbstractClient
Subclasses must implement this method to return aEventStoreClient
.- Specified by:
createEventStoreClient
in classAbstractClient
-
createSchedulingClient
Description copied from class:AbstractClient
Subclasses must implement this method to return aSchedulingClient
.- Specified by:
createSchedulingClient
in classAbstractClient
-
createKeyValueClient
Description copied from class:AbstractClient
Subclasses must implement this method to return aKeyValueClient
.- Specified by:
createKeyValueClient
in classAbstractClient
-
createSearchClient
Description copied from class:AbstractClient
Subclasses must implement this method to return aSearchClient
.- Specified by:
createSearchClient
in classAbstractClient
-
shutDown
public void shutDown()Description copied from interface:Client
Shuts down this client instance, releasing any underlying resources.This includes closing websocket sessions, stopping tracking, and executing registered shutdown hooks.
- Specified by:
shutDown
in interfaceClient
- Overrides:
shutDown
in classAbstractClient
-