Package io.quarkus.websockets.next
Annotation Interface WebSocketClient
@Retention(RUNTIME)
@Target(TYPE)
@Experimental("This API is experimental and may change in the future")
public @interface WebSocketClient
Denotes a WebSocket client endpoint.
An endpoint must declare a method annotated with OnTextMessage, OnBinaryMessage, OnPongMessage or
OnOpen. An endpoint may declare a method annotated with OnClose.
Lifecycle and concurrency
Client endpoint implementation class must be a CDI bean. If no scope annotation is defined thenSingleton is used.
ApplicationScoped and Singleton client endpoints are shared accross all WebSocket client connections.
Therefore, implementations should be either stateless or thread-safe.-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionBy default, the fully qualified name of the annotated class is used.The mode used to process incoming events for a specific connection. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstant value forclientId()indicating that the fully qualified name of the annotated class should be used.
-
Field Details
-
FCQN_NAME
Constant value forclientId()indicating that the fully qualified name of the annotated class should be used.- See Also:
-
-
Element Details
-
path
String pathThe path of the endpoint on the server.It is possible to match path parameters. The placeholder of a path parameter consists of the parameter name surrounded by curly brackets. The actual value of a path parameter can be obtained using
WebSocketClientConnection.pathParam(String). For example, the path/foo/{bar}defines the path parameterbar.- See Also:
-
-
-
clientId
String clientIdBy default, the fully qualified name of the annotated class is used.- Returns:
- the endpoint id
- See Also:
- Default:
- "<<fcqn name>>"
-
inboundProcessingMode
InboundProcessingMode inboundProcessingModeThe mode used to process incoming events for a specific connection.- Default:
- SERIAL
-