@Retention(value=RUNTIME) @Target(value=TYPE) @Documented @Import(value=DefaultWampConfiguration.class) public @interface EnableWamp
@Configuration class to enable the WAMP support. A
default endpoint '/wamp' will be registered.
@Configuration
@EnableWamp
public class MyAppConfig {
}
Another way to enable WAMP is by creating a @Configuration class that extends
AbstractWampConfigurer.
@Configuration
@EnableAutoConfiguration
@EnableWamp
public class Config extends AbstractWampConfigurer {
@Override
public void registerWampEndpoints(WampEndpointRegistry registry) {
registry.addEndpoint("/wampOverSockJS").withSockJS();
}
}
The third way to enable WAMP support is by creating a @Configuration class that
extends DefaultWampConfiguration. Don't add the @EnableWamp annotation in
this case.
@Configuration
public class MyAppConfig extends DefaultWampConfiguration {
@Bean
public Executor clientInboundChannelExecutor() {
ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
executor.setThreadNamePrefix("wampClientInboundChannel-");
executor.setCorePoolSize(4);
executor.setMaxPoolSize(2000);
executor.setKeepAliveSeconds(120);
executor.setQueueCapacity(2000);
executor.setAllowCoreThreadTimeOut(true);
return executor;
}
@Override
public void registerWampEndpoints(WampEndpointRegistry registry) {
registry.addEndpoint("/wamp").withSockJS();
}
}
Copyright © 2014–2017. All rights reserved.