I am integrating spring web sockets into a web application. And I want to use this for two calls that take up a lot of time in ajax. In my understanding, I see that there are different design options, how can I deal with this. Iām thinking about the following: can you tell me what will be the best option, and if so, why
1) Open the socket connection when the user logs into the application via SockJS and uses this connection to send messages and sign the two calls that I want to make. One of the questions I had with this design is that if the user just closes the browser, will the socket connection remain open?
2) Open the socket connection for each call and close it after receiving the message, but here it takes a lot of resources to establish the connection every time.
I'm new to spring -websocket, SockJS and STOMP, so let me know that my understanding is not right anywhere?
Thank you in advance
source
share