270 questions
49 votes
5 answers
32k views
Does Spring @SubscribeMapping really subscribe the client to some topic?
I am using Spring Websocket with STOMP, Simple Message Broker. In my @Controller I use method-level @SubscribeMapping, which should subscribe the client to a topic so that the client would receive the ...
21 votes
6 answers
50k views
Could not autowire. No beans of SimpMessagingTemplate type found
I am configuring Websockets in Spring basically by following the guide provided in the documentation. I am currently trying to send a message from the server to the client as explained in the section ...
17 votes
5 answers
17k views
Spring Websockets @SendToUser without login?
I have a simple spring application with websocket functionality and everything works so far. Now I want to send a message from my server to a specific client using the @SendToUser annotation. This ...
17 votes
1 answer
5k views
Spring Security with WebSockets - Forbidden 403
I have implemented WebSocket in Spring. Everything worked fine, but recently I decided to implement Spring Security. My MessageBroker looks like : @Configuration @EnableWebSocketMessageBroker @...
16 votes
2 answers
14k views
How to send ERROR message to STOMP clients with Spring WebSocket?
I am using Spring's STOMP over WebSocket implementation with a full-featured ActiveMQ broker. When users SUBSCRIBE to a topic, there is some permissions logic that they must pass through before being ...
16 votes
2 answers
19k views
How to get/set the principal and session attributes from Spring 4 stomp websocket methods
I'm doing experiments with Spring 4 websockets and stomp, and I have a hard time figuring out how to get/set the current user and other session attributes in a message handling method annotated with @...
15 votes
1 answer
12k views
Prevent spring-cloud-aws-messaging from trying to stop the queue
I'm using spring-cloud-aws-messaging in a Spring Boot project. I have SQS queue created manually in AWS. It is being used like: @SqsListener("${sqs.name.incoming}") public void listen(String message)...
10 votes
0 answers
10k views
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 ...
9 votes
2 answers
7k views
Spring-Cloud-AWS vs AWS-SDK-Java 2
Ours is a Spring-Boot based application. For integration with AWS SNS and SQS, we have couple of options: Use Spring-Cloud-AWS Use AWS-SDK-Java 2 I wanted to know if there is any advantage in using ...
9 votes
2 answers
5k views
How to globally handle Spring WebSockets/Spring Messaging exception?
Question Is there a way to globally handle Spring Messaging MessageDeliveryException caused by error (usualy insufficient authorities) in Spring WebSocket module? Use case I have implemented Spring ...
9 votes
1 answer
3k views
Spring WebSocket MessageMapping not working
I need to write chat. But I have a problem, I can't trigger MessageMapping controller. App contains of 2 parts, front-end which runs on 4200 port and back-end which is running on 8080 port. I have set ...
8 votes
2 answers
11k views
Check auth while sending a message to a specific user by using STOMP and WebSocket in Spring
I'm developing a realtime notification system in Spring 4 by using a build-in Message Broker, and STOMP over WebSocket. I would like to be able to send messages to a specific user, according with his ...
8 votes
1 answer
5k views
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 ...
8 votes
2 answers
3k views
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 ...
8 votes
1 answer
6k views
How to close a STOMP websocket in a spring server
I am using spring-websocket and spring-messaging (version 4.2.2.RELEASE) to implement STOMP over websockets with a fully-featured broker (Apache ActiveMQ 5.10.0). My clients are meant to SUBSCRIBE to ...