Questions tagged [spring-websocket]

A Spring Framework module that support WebSocket-style messaging in web applications (native websocket and with SockJS support), including use of STOMP as an application level WebSocket sub-protocol.

This implementation supports the websocket protocol (RFC6455) and the Java websocket API (JSR-356), with fallback options using SockJS.

See:

1417 questions
6
votes
1 answer

Test websocket in spring boot application

I don't understand how properly write a test case for websocket in springboot application. I have a class that implement WebSocketHandler and I add this handler in WebSocketConfigurer: @Configuration @EnableWebSocket public class WebSocketConfig…
dzrkot
  • 543
  • 2
  • 4
  • 23
6
votes
1 answer

Spring Stomp over Websocket: Message/Buffer/Cache/Stream limits

Could not understand the different parameters in the stomp over websocket config I am using for developing a chat application that involves images/vidoes: I notice that the SockJs in webpage, sends message with a frame size of 16K. I also tested…
kukkuz
  • 41,512
  • 6
  • 59
  • 95
6
votes
1 answer

Websockets + Spring boot + Kubernetes

I am creating a Facebook multiplayer game and am currently evaluating my tech stack. My game would need to use websockets and I would like to use Spring Boot. Now, I can not find the info if websocket server will work nicely in Kubernetes? For…
Saša Šijak
  • 8,717
  • 5
  • 47
  • 82
6
votes
2 answers

SockJS -> Infinite xhr-streaming calls after reconnect

im using Stomp over SockJS and Spring websockets as backend. Occasionally Im having problems after my stomp client reconnect (wifi loss, server down, other). The connection is perfectly restored but passed few seconds i can see in browser network…
6
votes
1 answer

Building custom API over Spring Websockets

I'm have to implement custom API over Websockets that requires: Custom WAMP-like subprotocol Path parameters in socket URI So I've following questions: Is there any documentation or guides on implementing custom subprotocols in Spring? Protocol…
Gris
  • 303
  • 1
  • 3
  • 10
6
votes
1 answer

How to change authentication type in jhipster created application

I have created my project which required spring web socket using Jhipster with Token based authentication. Lately I found that Token based authentication does not work with spring web socket from here. How to change authentication type without…
San
  • 341
  • 8
  • 22
6
votes
2 answers

Spring Boot Stomp WebSocket

I seem to be running into an issue bumping up against the 8k size limit that embedded tomcat has for stomp websocket messages. When sending a message from server to client I am getting the following error. Based on the documentation I've read, it…
6
votes
0 answers

Why can't I get call function afterConnectionClosed() in my TextWebSocketHandler?

In the server end, I use Spring-websocket, Handshake as follow: public class WebsocketEndPoint extends TextWebSocketHandler { @Override protected void handleTextMessage(WebSocketSession session, TextMessage message) throws…
6
votes
2 answers

Sending Error message in Spring websockets

I am trying to send error messages in Spring websockets with STOMP over SockJS. I am basically trying to achieve which is being done here. This is my Exception Handler @MessageExceptionHandler @SendToUser(value = "/queue/error",broadcast =…
Karthik
  • 4,950
  • 6
  • 35
  • 65
6
votes
1 answer

Is it possible to send synchronous messages via Spring WebSocket?

I have a Spring application and it sends messages to another server asynchronously via Spring WebSocket . But for a specific case I need to send a message synchronously, I should continue the process with incoming response from the server. I don’t…
azizunsal
  • 2,074
  • 1
  • 25
  • 33
6
votes
2 answers

Spring 4.2.0 - How to use SimpUserRegistry

According with the Spring 4.2.0 documentation, item 5.5, I'm trying to use SimpUserRegistry to get the users list connected to an websockets/STOMP endpoint ...but I'm pretty new on Spring and I just don't know where/how to use this class. Can you…
cgraf
  • 165
  • 1
  • 2
  • 8
6
votes
2 answers

How to use Spring WebSocketClient with SSL?

I connect with my websocket client to non-SSL endpoint without any problem. But I cannot find any way how to connect to wss (SSL) endpoint. Where can I define the SSL factory etc. No object seem to have related set method. WebSocketClient transport…
Mejmo
  • 2,363
  • 9
  • 35
  • 54
6
votes
3 answers

Request or Session scope in Spring Websocket

From WebSocket Endpoint I try to call Singleton Service. But I an unable to use Request or Session scope from WebSocket. (@Scope( value = "request", proxyMode = ScopedProxyMode.TARGET_CLASS)) I get Scope 'request' is not active for the current…
Tonci Jelavic
  • 61
  • 1
  • 4
6
votes
1 answer

How to implement WebSocketContainer into StandardWebSocketClient class

I am attempting to connect to a SockJs web sockets server via Spring 4.2 WebsocketClient support. This is my client so far: public static void main(String[] args) throws Exception { WebSocketClient transport = new StandardWebSocketClient(); …
a.hrdie
  • 716
  • 2
  • 14
  • 35
6
votes
0 answers

Manually setting authenticated user on a websocket session using spring security

I'm developing a Spring boot application using STOMP messaging over a websocket implementing an RPC pattern which exposes public (i.e.: without any need to be authenticated) and private methods. Two public methods exists to register and authenticate…