Uploaded image for project: 'Spring Framework'
  1. Spring Framework
  2. SPR-12886

Improve docs on concurrent sending with direct use of WebSocket API

    XMLWordPrintable

    Details

    • Last commented by a User:
      true

      Description

      Inside the websocket package there is the ConcurrentWebSocketSessionDecorator class. I'm thinking of using this because I have multiple components writing to the same websocket and want to remove the external locking I now have in place.

      But I can't find any example of the way to use this class. I'm thinking something like this should do it:

      public class MyWebsocketHandler extends TextWebSocketHandler {
      @Override
      protected void handleTextMessage(WebSocketSession websocketSession, TextMessage message) throws Exception {
          ConcurrentWebSocketSessionDecorator concurrentWebsocketSession = new ConcurrentWebSocketSessionDecorator(websocketSession, sendTimeLimit, bufferSizeLimit);
      ....
      

      ... then have the concurrentWebsocketSession sent downstream to all components who need it.

      Is this all there is to it? Could the documentation be updated to at least mention this (very useful) class?

        Attachments

          Activity

            People

            Assignee:
            rstoya05-aop Rossen Stoyanchev
            Reporter:
            knockoutuser knockout user
            Last updater:
            Spring Issues Spring Issues
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 19 weeks, 4 days ago