Package io.quarkus.websockets.next
Annotation Interface WebSocket
@Retention(RUNTIME)
@Target(TYPE)
@Experimental("This API is experimental and may change in the future")
public @interface WebSocket
Denotes a WebSocket server 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
Endpoint implementation class must be a CDI bean. If no scope annotation is defined thenSingleton is used.
ApplicationScoped and Singleton endpoints are shared accross all WebSocket 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 forendpointId()indicating that the fully qualified name of the annotated class should be used.
-
Field Details
-
FCQN_NAME
Constant value forendpointId()indicating that the fully qualified name of the annotated class should be used.- See Also:
-
-
Element Details
-
path
String pathThe path of the endpoint.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
WebSocketConnection.pathParam(String). For example, the path/foo/{bar}defines the path parameterbar.- See Also:
-
-
-
endpointId
String endpointIdBy 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
-