Java Code Examples for org.springframework.messaging.simp.config.ChannelRegistration#setInterceptors()

The following examples show how to use org.springframework.messaging.simp.config.ChannelRegistration#setInterceptors() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WebSocketStompConfig.java    From Project with Apache License 2.0 5 votes vote down vote up
@Override
public void configureClientInboundChannel(ChannelRegistration registration) {
	registration.setInterceptors(new ChannelInterceptorAdapter() {

		@Override
		public Message<?> preSend(Message<?> message, MessageChannel channel) {
			System.out.println("configureClientInboundChannel");
			StompHeaderAccessor accessor = StompHeaderAccessor.wrap(message);
			User user = (User) accessor.getSessionAttributes().get("user");
			return super.preSend(message, channel);
		}
		
	});
}
 
Example 2
Source File: WebSocketConfig.java    From metasfresh-webui-api-legacy with GNU General Public License v3.0 5 votes vote down vote up
@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().
}
 
Example 3
Source File: WebSocketConfiguration.java    From haven-platform with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientInboundChannel(ChannelRegistration registration) {
    registration.setInterceptors(interceptor);
}
 
Example 4
Source File: TraceWebSocketAutoConfiguration.java    From spring-cloud-sleuth with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientOutboundChannel(ChannelRegistration registration) {
	registration.setInterceptors(TracingChannelInterceptor.create(this.tracing));
}
 
Example 5
Source File: TraceWebSocketAutoConfiguration.java    From spring-cloud-sleuth with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientInboundChannel(ChannelRegistration registration) {
	registration.setInterceptors(TracingChannelInterceptor.create(this.tracing));
}
 
Example 6
Source File: WebSocketConfig.java    From bearchoke with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientInboundChannel(ChannelRegistration channelRegistration) {
    channelRegistration.setInterceptors(sessionContextChannelInterceptorAdapter());
}