org.springframework.messaging.simp.config.ChannelRegistration Java Examples

The following examples show how to use org.springframework.messaging.simp.config.ChannelRegistration. 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: 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 #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 configureClientOutboundChannel(final ChannelRegistration registration)
{
	//
	// IMPORTANT: make sure we are using only one thread for sending outbound messages.
	// If not, it might be that the messages will not be sent in the right order,
	// and that's important for things like WS notifications API.
	// ( thanks to http://stackoverflow.com/questions/29689838/sockjs-receive-stomp-messages-from-spring-websocket-out-of-order )
	registration.taskExecutor()
			.corePoolSize(1)
			.maxPoolSize(1);
}
 
Example #3
Source File: WebSocketAuthenticationSecurityConfigTest.java    From joal with Apache License 2.0 5 votes vote down vote up
@Test
public void shouldRegisterInterceptors() {
    final AuthChannelInterceptorAdapter authAdaptor = mock(AuthChannelInterceptorAdapter.class);
    final WebSocketAuthenticationSecurityConfig webSocketAuthenticationSecurityConfig = spy(new WebSocketAuthenticationSecurityConfig(authAdaptor));

    final ChannelRegistration registration = mock(ChannelRegistration.class);
    webSocketAuthenticationSecurityConfig.configureClientInboundChannel(registration);

    verify(registration, times(1)).interceptors(any());
    verify(webSocketAuthenticationSecurityConfig, times(1)).createChannelInterceptors();
}
 
Example #4
Source File: WebSocketConfig.java    From spring-boot-start-current with Apache License 2.0 5 votes vote down vote up
/**
 * 通道
 *
 * @param registration
 */
@Override
public void configureClientInboundChannel ( ChannelRegistration registration ) {
	if ( Objects.nonNull( channelInterceptor ) ) {
		registration.interceptors( channelInterceptor );
	}

}
 
Example #5
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 #6
Source File: WebSocketConfig.java    From geode-demo-application with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientOutboundChannel(ChannelRegistration registration) {
    registration.taskExecutor().corePoolSize(4).maxPoolSize(10);
}
 
Example #7
Source File: WebSocketConfig.java    From flex-poker with GNU General Public License v2.0 4 votes vote down vote up
@Override
public void configureClientOutboundChannel(ChannelRegistration registration) {
    registration.taskExecutor().corePoolSize(4).maxPoolSize(10);
}
 
Example #8
Source File: WebSocketConfig.java    From bearchoke with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientOutboundChannel(ChannelRegistration channelRegistration) {
}
 
Example #9
Source File: DelegatingWebSocketMessageBrokerConfiguration.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
protected void configureClientInboundChannel(ChannelRegistration registration) {
	for (WebSocketMessageBrokerConfigurer configurer : this.configurers) {
		configurer.configureClientInboundChannel(registration);
	}
}
 
Example #10
Source File: DelegatingWebSocketMessageBrokerConfiguration.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
protected void configureClientOutboundChannel(ChannelRegistration registration) {
	for (WebSocketMessageBrokerConfigurer configurer : this.configurers) {
		configurer.configureClientOutboundChannel(registration);
	}
}
 
Example #11
Source File: AbstractWebSocketMessageBrokerConfigurer.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientInboundChannel(ChannelRegistration registration) {
}
 
Example #12
Source File: AbstractWebSocketMessageBrokerConfigurer.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientOutboundChannel(ChannelRegistration registration) {
}
 
Example #13
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 #14
Source File: WebSocketConfig.java    From geode-demo-application with Apache License 2.0 4 votes vote down vote up
@Override
	public void configureClientInboundChannel(ChannelRegistration registration) {
}
 
Example #15
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());
}
 
Example #16
Source File: WebSocketConfig.java    From cloudstreetmarket.com with GNU General Public License v3.0 4 votes vote down vote up
@Override
public void configureClientInboundChannel(ChannelRegistration registration) {
	registration.taskExecutor().corePoolSize(Runtime.getRuntime().availableProcessors() *4);
}
 
Example #17
Source File: WebSocketConfig.java    From cloudstreetmarket.com with GNU General Public License v3.0 4 votes vote down vote up
@Override
//Increase number of threads for slow clients
public void configureClientOutboundChannel(ChannelRegistration registration) {
	registration.taskExecutor().corePoolSize(Runtime.getRuntime().availableProcessors() *4);
}
 
Example #18
Source File: WebSocketConfig.java    From consensusj with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientInboundChannel(ChannelRegistration registration) {
}
 
Example #19
Source File: WebSocketConfig.java    From consensusj with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientOutboundChannel(ChannelRegistration registration) {
    registration.taskExecutor().corePoolSize(4).maxPoolSize(10);
}
 
Example #20
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 #21
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 #22
Source File: AbstractSessionWebSocketMessageBrokerConfigurer.java    From spring-session with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientInboundChannel(ChannelRegistration registration) {
	registration.interceptors(sessionRepositoryInterceptor());
}
 
Example #23
Source File: WebSocketConfig.java    From glowroot with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientInboundChannel(ChannelRegistration registration) {}
 
Example #24
Source File: WebSocketConfig.java    From glowroot with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientOutboundChannel(ChannelRegistration registration) {}
 
Example #25
Source File: WebSocketConfig.java    From botanic-ng with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientOutboundChannel(ChannelRegistration registration) {
	registration.taskExecutor().corePoolSize(4).maxPoolSize(10);
}
 
Example #26
Source File: WebSocketAuthenticationSecurityConfig.java    From joal with Apache License 2.0 4 votes vote down vote up
@Override
public void configureClientInboundChannel(final ChannelRegistration registration) {
    registration.interceptors(this.createChannelInterceptors());
}
 
Example #27
Source File: WebSocketMessageBrokerConfig.java    From tutorials with MIT License 4 votes vote down vote up
@Override
public void configureClientOutboundChannel(ChannelRegistration registration) {
    // TODO Auto-generated method stub

}
 
Example #28
Source File: DelegatingWebSocketMessageBrokerConfiguration.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
protected void configureClientInboundChannel(ChannelRegistration registration) {
	for (WebSocketMessageBrokerConfigurer configurer : this.configurers) {
		configurer.configureClientInboundChannel(registration);
	}
}
 
Example #29
Source File: DelegatingWebSocketMessageBrokerConfiguration.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
protected void configureClientOutboundChannel(ChannelRegistration registration) {
	for (WebSocketMessageBrokerConfigurer configurer : this.configurers) {
		configurer.configureClientOutboundChannel(registration);
	}
}
 
Example #30
Source File: AbstractWebSocketMessageBrokerConfigurer.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Override
public void configureClientInboundChannel(ChannelRegistration registration) {
}