Edit: Please do not downvote without leaving at least a comment.
I'd like to implement websocket in a SpringBoot application without Message Broker and STOMP. However, I need to access Spring Beans (repositories and services).
The Java API is so simple that I can't understand why Spring made it so complex.
Here's what I need:
I need to implement a websocket endpoint with dynamic URI so I can use @PathParam
like this:
@ServerEndpoint(value = "/chat/{username}")
public class wsEndpoint
Using @EnableWebSocket
with WebSocketConfigurer
and TextWebSocketHandler
only allows me to implement static endpoints.
The alternative recommended by Spring documentation is to implement Message Brokers and STOMP, which makes usage (IMHO) unnecessarily complex for most cases.
I really would like to use @EnableWebSocket
with WebSocketConfigurer
, TextWebSocketHandler
and dynamic URIs. Is there a way to do so?