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
9
votes
1 answer

403 Forbidden Spring Boot Web Socket Call

I am using Spring Boot 1.3.0.RELEASE. My code is based on the Starting Guide for websocket in Spring Boot using Stomp and SocketJS. When I run the Client from localhost:8080 (Spring Server)... Of course it works. Its not until I try to call it from…
numerical25
  • 10,524
  • 36
  • 130
  • 209
9
votes
0 answers

Spring security websocket and HTTP authentication/authorization

Summary I would like to implement websocket communication over STOMP. Authenticate The user in the time of the first (HTTP request) websocket handshake and use this Principal for authorizing websocket messages later. Problem The system…
9
votes
1 answer

How to correctly implement a spring-websocket java client

I am working on a Spring WebSocket Stomp Client for my WebSocket Server and I am getting conflicting information. I have found 2 ways to get it to work and without going into too much detail I was wondering which way is considered the "correct" way…
9
votes
2 answers

Spring Web Socket Java Client

How to Write a Java based Spring Web Socket (STOMP) Client. As in Spring we have only javascript based client is provided using stompJS but if we need a java client how should we need to achive it?
Sathish Kumar k k
  • 1,732
  • 5
  • 26
  • 45
9
votes
1 answer

Is there any solution can send message to a group of user (not all user) using spring4 websocket?

Recently, I use spring4 websocket to push message to end user. I known that, there are 2 methods (convertAndSend, convertAndSendToUser) to send message in class SimpMessageSendingOperations . But is there any way to send message to a group of…
Xiujun Ma
  • 2,574
  • 1
  • 14
  • 19
8
votes
4 answers

Build jar and run spring boot from cmd

I'm new to springboot and using springboot 2 version. I would like to run my spring boot application using : java -jar my-app-0.0.1-SNAPSHOT.jar from the command prompt. However, when i build the application using eclipse it calls…
8
votes
2 answers

"message:Broker not available." error when implementing stomp over spring websocket

I'm building a sample chat app using spring WebSocket, SockJs and Amazon MQ. It is throwing a 'broker not available' exception when the client subscribes to the topic. All the inbound traffic rules are set correctly in the AWS security groups, and…
Vishnu S Kumar
  • 666
  • 7
  • 24
8
votes
1 answer

Spring WebSocket Stomp Exception Handling

I am trying to use Websockets and STOMP 1.2. I want to authenticate user using JWT on CONNECT frame and to return error message if authorization is not valid. Here is channel interceptor @Configuration @EnableWebSocketMessageBroker public class…
Boris
  • 726
  • 1
  • 10
  • 22
8
votes
2 answers

What is the proper way to use Spring WebSocketConnectionManager when sessions closes

I use Spring's WebSocketConnectionManager to work with WebSockets. Sometimes the connection closes and I have to reconnect. But I didn't find any proper solution to do that. Can I use WebSocketConnectionManager for restore (reconnect to) session? In…
Arkady
  • 1,178
  • 14
  • 35
8
votes
1 answer

How to intercept connection and subscription with Spring Stomp

I need to control connection/disconnection and subscriptions/unsubscriptions of stomp clients in my websocket spring server. This is the main configuration class: @Configuration @ComponentScan(basePackages =…
Tobia
  • 9,165
  • 28
  • 114
  • 219
8
votes
2 answers

Why is SimpUserRegistry not working properly on EC2 Instance

I am using SimpUserRegistry to get online user-count (with getUserCount()). And it is working good on my local machines but not on AWS EC2 instances (tried with Amazon Linux and Ubuntu) with just elastic IP and no load balancer. The problem on EC2…
Bhesh Gurung
  • 50,430
  • 22
  • 93
  • 142
8
votes
2 answers

SockJS fails to create/connect to Spring WebSocket

I am learning Spring WebSocket. I have successfully run this Spring WebSocket tutorial. Now I am trying to incorporate it as-is in my existing Spring MVC application. When I run it from Chrome browser, I see below error in its dev console. Chrome…
user890263
  • 159
  • 1
  • 3
  • 13
8
votes
3 answers

Loadbalancing web sockets - AWS Elastic Loadbalancer

I have a question about how to load balance web sockets with AWS elastic load balancer. I have 2 EC2 instances behind AWS elastic load balancer. When any user login, the user session will be established with one of the server, say EC2 instance1.…
user1578872
  • 7,808
  • 29
  • 108
  • 206
8
votes
1 answer

Websocket working on localhost but not Heroku

I have an application that uses websockets (STOMP over SockJs), with Spring at the backend. Application works fine (websockets) on localhost on Tomcat but when I deploy to Heroku or AWS Web Sockets stop working. My websocket configuration in…
Lukasz
  • 691
  • 1
  • 12
  • 30
8
votes
2 answers

Spring Websocket STOMP load testing

I am developing a messaging application using Spring REST, Websocket/STOMP and RabbitMQ. We use are using gatling for load/stress testing the REST end points of the application. However, we would like to know how many messages can be processed with…
user3600073
  • 1,773
  • 3
  • 18
  • 21