@Bean
    public Map<String, WebSocketSession> onlineUserCache() {
        return new HashMap<>();
    }
Use map as simple cache.
@return  session cache
shenyu-examples/shenyu-examples-websocket/shenyu-example-spring-annotation-websocket/src/main/java/org/apache/shenyu/examples/websocket/TestAnnotationWebsocketApplication.java