@RequestMapping("/sendMsg")
    @Log
    @ResponseBody
    public String sendMsg(final String token, final String msg) {
        WebSocketSession webSocketSession = WsSessionManager.get(token);
        if (Objects.isNull(webSocketSession)) {
            return "User login has expired";
        }
        try {
            webSocketSession.sendMessage(new TextMessage(msg));
        } catch (IOException e) {
            LOG.error("throw exception when sending message.", e);
        }
        return "Message sent successfully";
    }
")
public class TestHttpController {

    private static final Logger LOG = LoggerFactory.getLogger(TestHttpController.class);
    
    /**
Send message.
@param token session key
@param msg text-type message
@return response
shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-native-websocket/src/main/java/org/apache/shenyu/examples/websocket/controller/TestHttpController.java