WebSocketMessageBrokerConfigurer

↘锁芯ラ 提交于 2019-12-11 07:41:53

问题


    public abstract class AbstractSessionWebSocketMessageBrokerConfigurer<S extends ExpiringSession> extends AbstractWebSocketMessageBrokerConfigurer {
    @Override
        public void configureWebSocketTransport(WebSocketTransportRegistration registration) {
            registration.addDecoratorFactory(wsConnectHandlerDecoratorFactory());
        }

    static class SessionStompEndpointRegistry implements StompEndpointRegistry {
            private final StompEndpointRegistry registry;
            private final HandshakeInterceptor interceptor;

            public SessionStompEndpointRegistry(StompEndpointRegistry registry,
                    HandshakeInterceptor interceptor) {
                this.registry = registry;
                this.interceptor = interceptor;
            }

            public StompWebSocketEndpointRegistration addEndpoint(String... paths) {
                StompWebSocketEndpointRegistration endpoints = registry.addEndpoint(paths);
                endpoints.addInterceptors(interceptor);
                return endpoints;
            }
        }

registration.addDecoratorFactory(wsConnectHandlerDecoratorFactory()); and endpoints.addInterceptors(interceptor); which doesn't exsit. How to write it is correct?


回答1:


All those features are available in the latest Spring Framework versions. Try to use 4.1.3: http://spring.io/blog/2014/12/09/spring-framework-4-1-3-released



来源:https://stackoverflow.com/questions/27353716/websocketmessagebrokerconfigurer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!