Example usage for org.springframework.messaging.support ExecutorSubscribableChannel ExecutorSubscribableChannel

List of usage examples for org.springframework.messaging.support ExecutorSubscribableChannel ExecutorSubscribableChannel

Introduction

In this page you can find the example usage for org.springframework.messaging.support ExecutorSubscribableChannel ExecutorSubscribableChannel.

Prototype

public ExecutorSubscribableChannel(@Nullable Executor executor) 

Source Link

Document

Create a new ExecutorSubscribableChannel instance where messages will be sent via the specified executor.

Usage

From source file:ch.rasc.wampspring.config.DefaultWampConfiguration.java

/**
 * Channel for inbound messages between {@link WampSubProtocolHandler},
 * {@link #brokerMessageHandler()} and {@link #annotationMethodMessageHandler()}
 *///  w w  w  . j  a v  a2 s. c o  m
@Bean
public SubscribableChannel clientInboundChannel() {
    ExecutorSubscribableChannel executorSubscribableChannel = new ExecutorSubscribableChannel(
            clientInboundChannelExecutor());
    configureClientInboundChannel(executorSubscribableChannel);
    return executorSubscribableChannel;
}

From source file:ch.rasc.wampspring.config.DefaultWampConfiguration.java

/**
 * Channel for outbound messages sent back to WebSocket clients.
 *//*from  w w w . j a v  a2  s.c  o m*/
@Bean
public SubscribableChannel clientOutboundChannel() {
    return new ExecutorSubscribableChannel(clientOutboundChannelExecutor());
}

From source file:ch.rasc.wampspring.config.DefaultWampConfiguration.java

/**
 * Channel from the application to the {@link #brokerMessageHandler()}
 *///w ww  . j  av a 2s . c  o m
@Bean
public SubscribableChannel brokerChannel() {
    return new ExecutorSubscribableChannel(brokerChannelExecutor());
}

From source file:org.springframework.messaging.simp.broker.OrderedMessageSenderTests.java

@Before
public void setup() {
    this.executor = new ThreadPoolTaskExecutor();
    this.executor.setCorePoolSize(Runtime.getRuntime().availableProcessors() * 2);
    this.executor.setAllowCoreThreadTimeOut(true);
    this.executor.afterPropertiesSet();

    this.channel = new ExecutorSubscribableChannel(this.executor);
    OrderedMessageSender.configureOutboundChannel(this.channel, true);

    this.sender = new OrderedMessageSender(this.channel, logger);

}