Class SocketRequest
Each SocketRequest
includes a unique requestId
used to track and match responses, and a
JsonNode
representation of the actual request payload.
Requests are typically created using the static valueOf(Object)
method, which serialize the original request
object to JSON. The requestId
can be autogenerated or provided explicitly.
Note: In most cases, SocketRequest
s and SocketResponse
s are created and handled
automatically by the SocketSession
. Developers working within a Flux Capacitor system typically do not need
to construct them manually. However, understanding their format becomes important when integrating with non-Flux
systems—such as a browser-based UI—over WebSocket. In such scenarios, this class defines the structure of a request
expected by a Flux client.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final AtomicLong
Counter used to generate unique request IDs for new socket requests. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SocketRequest
Creates a newSocketRequest
with an auto-incremented ID and the given request object.
-
Field Details
-
counter
Counter used to generate unique request IDs for new socket requests.
-
-
Constructor Details
-
SocketRequest
public SocketRequest()
-
-
Method Details
-
valueOf
Creates a newSocketRequest
with an auto-incremented ID and the given request object.- Parameters:
request
- the request object to be sent over the WebSocket session- Returns:
- a new
SocketRequest
instance with a unique ID
-