Websocket push notification with Spring Boot - STOMP - Part 4

Sdílet
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/

Komentáře • 16

  • @BabaykaMoscow
    @BabaykaMoscow Před 2 lety +9

    Could you please make a tutorial on securing STOMP messages with JWT & RBAC? Thanks!

  • @lalik777
    @lalik777 Před 2 lety +1

    Thank you for the series of videos and thank you for having increase the font in Intellij from 3d video !

  • @user-ux8fw6iu4q
    @user-ux8fw6iu4q Před rokem

    thank you👍

  • @arpitsohar174
    @arpitsohar174 Před 2 lety

    Very nice series, good job. How to subscribe these topics via Postman? What will happen to the messages if in between backend application restarted?

  • @petershankey7842
    @petershankey7842 Před 2 lety +1

    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.

  • @kimgysen10
    @kimgysen10 Před 2 lety

    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.

    • @liliumbosniacumcode
      @liliumbosniacumcode  Před 2 lety +2

      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.

  • @walk2sandeep
    @walk2sandeep Před rokem

    Can you show how to send jwt token in header to secure the connection?

  • @luisgonzalez752
    @luisgonzalez752 Před rokem

    Hi bro, can u explain how do in Maven? I have an error on the js file, not recognize the $ document.
    Ty

  • @tamilselvan152
    @tamilselvan152 Před 2 lety

    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

    • @liliumbosniacumcode
      @liliumbosniacumcode  Před 2 lety +1

      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.

    • @tamilselvan152
      @tamilselvan152 Před 2 lety

      @@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

  • @krztuszenie
    @krztuszenie Před rokem

    What if we want to send message, when second user is offline?

    • @mirza_2023
      @mirza_2023 Před rokem

      Then I would suggest you add extra logic that would load that message when user logges on

  • @iil3.378
    @iil3.378 Před rokem +2

    I want git code