Websocket push notification with Spring Boot - STOMP - Part 4
Vložit
- čas přidán 15. 11. 2021
- Short tutorial on how to use websocket to push some STOMP messages on specified topics to the frontend using Spring Boot. Same approach can be used for push notifications.
In this video we take a look how to send push notifications globally and to a specific user.
Spring Initializr: start.spring.io/
Source code: github.com/liliumbosniacum/we...
Intro by Audionautix is licensed under a Creative Commons Attribution 4.0 licence. creativecommons.org/licenses/
Artist: audionautix.com/
Could you please make a tutorial on securing STOMP messages with JWT & RBAC? Thanks!
Thank you for the series of videos and thank you for having increase the font in Intellij from 3d video !
thank you👍
Very nice series, good job. How to subscribe these topics via Postman? What will happen to the messages if in between backend application restarted?
Can you make a video on Spring acting as the client. IE One Spring server initiating the session, receiving the notifications/messages much like the JS/HTML pages do in the videos.
I liked your series, thanks. I'm considering whether I should use websockets for notifications. The default max of concurrent connections is around 10k users. Of course it is questionable whether this amount of users would ever be reached. But if it is the case, it means that every user needs an open websocket connection for the sake of notifications. I assume using SSE for this purpose (pure push-based, i.e. notifications / feed updates) could be the better options.
Second thought I have is about the number of topics this is able to handle. In my case I'm contemplating the use case of having one chat room per programming tag (one webpage = one programming tag), and there are thousands of them. It makes sense to dynamically create topics as they are requested, and remove them as there are no more subscribers to a certain topic. It doesn't make sense to keep clients connected globally if they shouldn't be (if they are not on the page that displays a certain topic). Do you know if the api offers this possibility? Also I could see additional problems with managing the rabbit cluster in prod in this scope. Would be nice if STOMP could handle this use case.
Thank you :)
Wow 10k sounds like a lot. To be honest I am not sure if that would work or not. I think tomcat even has a limit at 10k but this can be changed. You could build a cluster of your applications, and have some load balancer to distribute the load. I think that might help you out.
For your second question, sorry, I am not aware of any API that offers that.
Can you show how to send jwt token in header to secure the connection?
Hi bro, can u explain how do in Maven? I have an error on the js file, not recognize the $ document.
Ty
Hello i've seen all your websocket videos, i need to send particular user data to the same user in an scheduler, i need to send userid from my database
You would need to get the ID on the frontend in this case. For example if you login with a certain username you could fetch ID of the user from your backend based on that username, and then subscribe to that ID.
@@liliumbosniacumcode HI, above mentioned method worked for me,thank you so much,Is there any way to secure the websocket connection?Any security service ?please do help me out
What if we want to send message, when second user is offline?
Then I would suggest you add extra logic that would load that message when user logges on
I want git code
You can find it in the description.