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
5
votes
0 answers

WebFlux and Reactor 3.4.0 - Deprecated FluxProcessors - How to subscribe with a sink?

With Reactor 3.4.0 the different FluxProcessors like "DirectProcessor" is getting deprecated. I used such processor as subscribers, see example below. Now I am wondering how I have to migrate my code to make use of the recommended Sinks.many()…
megloff
  • 1,400
  • 4
  • 27
  • 44
5
votes
1 answer

Spring boot Websocket scaling

I have a spring boot application using web-sockets and stomp, I have to use the xhr-polling protocol because of limitations to our ISAM setup and this application will be hosted on Pivotal Cloud Foundry (PCF). When I run a single instance, with the…
5
votes
0 answers

Spring + Websockets + STOMP + Broker + Gateway does not scale

We have been evaluating Spring-Stomp-Broker-websockets, for a full duplex type messaging application that will run on AWS. We had hoped to use Amazon MQ. We are pushing messages to individual users, and also broadcasting. So functionally the stack…
5
votes
2 answers

How to have multiple subscribers to Flux that run on different execution contexts / threads

I'm developing a Spring Boot WebFlux application for IoT real time data visualization. I have a Flux which simulates data coming from a device, and I want that upon websocket connection established every single event: must be sent over the…
5
votes
1 answer

Spring WebFlux authenticated WebSocket connection

I have running Spring Boot@2.2.x server with exposed WebSocket endpoint. Here is my WebSocketConfiguration: @Slf4j @Configuration public class WebSocketConfiguration { private static final String WS_PATH = "/ws/notifications"; @Bean …
5
votes
2 answers

Real time notifications in spring boot web socket

In my application, I need to send real time notifications to a specific user. My WebSocketConfig class is as below, @Configuration @EnableWebSocketMessageBroker public class WebSocketConfig extends…
Virat
  • 551
  • 4
  • 9
  • 23
5
votes
1 answer

Failed to start bean 'subProtocolWebSocketHandler'; nested exception is java.lang.IllegalArgumentException: No handlers

Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. 2018-07-25 09:17:32.977 ERROR 8176 --- [ main] o.s.boot.SpringApplication : Application run…
Rajan Patel
  • 55
  • 1
  • 6
5
votes
0 answers

Spring WebSocket integration test works at random

I have absolutely simple SpringBoot project with simple configuration and simple integration test to test WebSockets. pom.xml
JiKra
  • 1,618
  • 3
  • 29
  • 45
5
votes
2 answers

Keep WebSocket connection alive after refresh

I have a real time application which used WebSockets between java spring server and browser. Is there a method to keep the Websocket connection alive after page refresh ? This is my javascript code: consumerWebSocket = new WebSocket("wss://" +…
pcCC28
  • 179
  • 1
  • 7
  • 20
5
votes
3 answers

Send message to client on connect via Spring Websocket

Okay, I have practically read every single stackoveflow post on spring websocket. I want to send a message to a particular client once it connects to the server, simple! I have been able to connect from the client, and I can listen for new…
Charles
  • 251
  • 4
  • 12
5
votes
3 answers

Exposing metrics about current Websocket connections with Spring

For my dashboarding application I want to monitor my Spring Boot based application with internal Spring metrics. Therefor I am using the spring-boot-actuator dependency which is exposing a lot of internal metrics. There are a lot of HTTP based…
rieckpil
  • 10,470
  • 3
  • 32
  • 56
5
votes
1 answer

Java WebSocket Client Spring boot

I want to create a spring boot app with a web socket client that connects to a web socket server. As an example, I used the Getting Started guide you can find in Spring Boot. https://spring.io/guides/gs/messaging-stomp-websocket/ In this example,…
Manuelarte
  • 1,658
  • 2
  • 28
  • 47
5
votes
2 answers

How to set proxy for Spring StandardWebSocketClient

I am trying to establish a WebSocket connection using Spring StandardWebSocketClient, but getting an error due to proxy settings as the server is running behind the proxy. Below is the code I am using. StandardWebSocketClient…
5
votes
4 answers

StompFrameHandler doesn't get payload from message

Finally I have my websocket client connecting to the endpoint but I can't extract message payload. I can get headers but payload is not recognized. My WebSocket client looks like below: WebSocketTransport webSocketTransport = new…
kris82pl
  • 977
  • 3
  • 12
  • 21
5
votes
2 answers

Examples of use ReactorNettyWebSocketClient

New Spring has some WebSocketClient example on Spring documentation. WebSocketClient client = new ReactorNettyWebSocketClient(); client.execute("ws://localhost:8080/echo"), session -> {... }).blockMillis(5000); But it is very short and not…
Aleksey Kozel
  • 319
  • 1
  • 9
  • 16