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

Why does STOMP functionality in spring-websocket depend on Spring MVC?

Currently, I am trying to use STOMP with websockets using webflux. In order to send a message to a STOMP topic, I need to use SimpMessagingTemplate, which is contributed by spring boot auto configuration when I add @EnableWebSocketMessageBroker But…
Ashok Koyi
  • 5,327
  • 8
  • 41
  • 50
6
votes
4 answers

Tomcat + Spring Boot + 'javax.websocket.server.ServerContainer' not found

I am trying to deploy a Spring Boot (2.0.5) web application (war) with web sockets to a Tomcat 8.5.37 server, it previously worked with Tomcat 7. My web socket configuration is throwing the exception and preventing the application from starting. Am…
Phil Ninan
  • 1,108
  • 1
  • 14
  • 23
6
votes
1 answer

Spring Boot + Spring Web Socket + RabbitMQ Web STOMP

I am working on adding live notification in my application I have done POC with - Spring Boot - Spring WebSocket - SockJS - RabbitMQ STOMP plugin I read about RabbitMQ Web STOMP and want to do POC of that. But it says Since version 3.7 support for…
n.sharvarish
  • 1,423
  • 4
  • 13
  • 13
6
votes
1 answer

Spring Security and Websocket with JWT Token

I have a Spring Boot project (2.0.0.RELEASE). I use JWT Token based authentication and authorization to secure REST. I also wanted to use Websocket with SockJS and use Token for socket authentication. I try to implement regarding this post, however…
6
votes
2 answers

Spring websocket EOFException

My project is using spring-boot web socket and embedded tomcat to implement chat server. Everything is ok but sometimes I got EOFException, and then the client cannot send a message to chat server until I restart tomcat then everything worked ok. I…
Andy
  • 131
  • 1
  • 1
  • 4
6
votes
5 answers

Spring Websocket STOMP: send RECEIPT frames

I have a Websocket-stomp server based on Spring and its SimpleBroker implementation (not utilizing an external broker). I would like to enable STOMP RECEIPT messages. How I could configure my code to send these automatically?
onkami
  • 8,791
  • 17
  • 90
  • 176
6
votes
0 answers

Websocket - IOException: Too many open files

I am using Spring boot's WebSocketConfigurer for creating websocket, as per following code to create a presence system. My users would connect to it and it will keep tracking their presence. @Configuration @EnableWebSocket public class…
Navdeep Soni
  • 449
  • 4
  • 15
6
votes
1 answer

Simple: convertAndSendToUser Where do I get a username?

In Spring Boot (Websockets) I just saw this example: messaging.convertAndSendToUser( username, "/queue/notifications", new Notification("You just got mentioned!")); Where does the guy get a username from? I can't find any…
durisvk10
  • 549
  • 1
  • 6
  • 11
6
votes
2 answers

How can I detect a disconnected client with Spring 5 Reactive WebSocket

I managed to create a WebSocketHandler using the Spring 5 Reactive WebSocket support (Chapter 23.2.4). Receiving and sending all works fine. However, I can not figure out how to detect a client disconnect. When debugging a client disconnect it…
Caparvil
  • 73
  • 1
  • 5
6
votes
1 answer

Spring STOMP server without SockJS/StompJS

I have Spring server with Spring Websocket support. I would like to use STOMP sub-protocol to handle communication over web sockets, so the configuration of STOMP endpoint looks as follow: @Configuration @EnableWebSocketMessageBroker public class…
Plebejusz
  • 3,332
  • 2
  • 19
  • 26
6
votes
2 answers

WebSocket client disconnect due to network loss doesn't get intercepted by Spring server

I have an application in which clients use websockets to connect to a server which is running Spring Boot Tomcat. My question is if there is a way for the server to detect a client disconnect due to a network loss. Thanks.
R. Potra
  • 71
  • 1
  • 5
6
votes
3 answers

Zuul with web socket

We currently have a direct Websocket connection that goes to a backend webservice from our UI Application. Now when we are trying to do the same through Zuul(ApiGateway) we are not able to connect to backend service We have gone through below…
6
votes
3 answers

How to wait for Spring WebSocketStompClient to connect

I am using this guide to implement a simple Stomp client: WebSocketClient webSocketClient = new StandardWebSocketClient(); WebSocketStompClient stompClient = new WebSocketStompClient(webSocketClient); ThreadPoolTaskScheduler taskScheduler = new…
timbre timbre
  • 12,648
  • 10
  • 46
  • 77
6
votes
0 answers

How to combine Spring Security and js sockjs-client

I want to create a Spring Server and a Broswer javascript client connecting via sockjs-client. The connection should be secured via Spring Security. I have the following dilemma: Spring Security seems to assume that the websocket handshake happens…
tkruse
  • 10,222
  • 7
  • 53
  • 80
6
votes
1 answer

STOMP over websockets vs plain STOMP. Which one is better?

As from spring 4, we have support of STOMP (sub)protocol over WebSocket. I do understand the benefits of WebSocket as compared to HTTP and the use & benefits of using STOMP over the WebSocket but I would like to understand the following: Are there…
Himanshu Jain
  • 65
  • 1
  • 6