Reputation: 6556
I could not find any information about the threading model used in Spring, and browsing the source code did not give me a straightforward answer. I was wondering about the threading limitations of using Spring websockets. I suspect the threading model is similar as handling ordinary HTTP request, but I could not find a definite answer.
Is the websocket implementation used by Spring asynchronous or can it block? Is it safe to use a websocket from other threads? Is is possible to configure Spring to only use a single thread to handle all the incoming messages?
I hope somebody can clarify how Spring handles threads in combinations with Websockets.
Upvotes: 5
Views: 1185
Reputation: 435
A bit late, but to not let this question be unanswered:
I think the reason why you couldn't find any hint in Spring is that the ws request handling and threading is not done in Spring but in the webserver.
So the question must be directed to tomcat or undertow or what is used in your application setup.
Upvotes: 2