Class MyWebSocketHandler

java.lang.Object
org.springframework.web.socket.handler.AbstractWebSocketHandler
org.springframework.web.socket.handler.TextWebSocketHandler
com.rale4j.sb.websocket.MyWebSocketHandler
All Implemented Interfaces:
org.springframework.web.socket.WebSocketHandler

@Component public class MyWebSocketHandler extends org.springframework.web.socket.handler.TextWebSocketHandler
Example WebSocket handler with rate-limiting annotations.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected void
    handleTextMessage(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.TextMessage message)
    Handles incoming WebSocket text messages with rate limiting.

    Methods inherited from class org.springframework.web.socket.handler.TextWebSocketHandler

    handleBinaryMessage

    Methods inherited from class org.springframework.web.socket.handler.AbstractWebSocketHandler

    afterConnectionClosed, afterConnectionEstablished, handleMessage, handlePongMessage, handleTransportError, supportsPartialMessages

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MyWebSocketHandler

      public MyWebSocketHandler()
  • Method Details

    • handleTextMessage

      protected void handleTextMessage(org.springframework.web.socket.WebSocketSession session, org.springframework.web.socket.TextMessage message) throws Exception
      Handles incoming WebSocket text messages with rate limiting.
      Overrides:
      handleTextMessage in class org.springframework.web.socket.handler.AbstractWebSocketHandler
      Parameters:
      session - the WebSocket session
      message - the incoming text message
      Throws:
      Exception - if an error occurs while handling the message