Example usage for org.springframework.messaging.simp.config ChannelRegistration setInterceptors

List of usage examples for org.springframework.messaging.simp.config ChannelRegistration setInterceptors

Introduction

In this page you can find the example usage for org.springframework.messaging.simp.config ChannelRegistration setInterceptors.

Prototype

@Deprecated
public ChannelRegistration setInterceptors(@Nullable ChannelInterceptor... interceptors) 

Source Link

Document

Configure interceptors for the message channel.

Usage

From source file:jp.pigumer.web.StompConfig.java

@Override
public void configureClientInboundChannel(ChannelRegistration registration) {
    registration.setInterceptors(new ChannelInterceptorAdapter() {
        @Override// www  .j a va 2  s  .  c om
        public Message<?> preSend(Message<?> message, MessageChannel channel) {
            StompHeaderAccessor accessor = StompHeaderAccessor.wrap(message);
            if (accessor.getCommand() == StompCommand.SUBSCRIBE) {
                LOGGER.log(Level.INFO, String.format("%s: %s", channel, message));
            }
            return message;
        }
    });
}

From source file:opensnap.config.WebSocketConfig.java

@Override
public void configureClientInboundChannel(ChannelRegistration registration) {
    this.interceptor.loadConfiguration("security.yml");
    registration.setInterceptors(this.interceptor).taskExecutor().corePoolSize(1).maxPoolSize(1);
}

From source file:com.northstrat.springsecurity.web.socket.AbstractSecurityWebSocketMessageBrokerConfigurer.java

@Override
public final void configureClientInboundChannel(ChannelRegistration registration) {
    ChannelSecurityInterceptor inboundChannelSecurity = inboundChannelSecurity();
    registration.setInterceptors(securityContextChannelInterceptor());

    registration.setInterceptors(inboundChannelSecurity);

    customizeClientInboundChannel(registration);
}

From source file:de.metas.ui.web.websocket.WebSocketConfig.java

@Override
public void configureClientInboundChannel(final ChannelRegistration registration) {
    registration.setInterceptors(new WebSocketChannelInterceptor());

    // NOTE: atm we don't care if the inbound messages arrived in the right order
    // When and If we would care we would restrict the taskExecutor()'s corePoolSize to ONE.
    // see: configureClientOutboundChannel().
}