Search in sources :

Example 1 with BlockingWebSocketSession

use of org.springframework.web.socket.handler.BlockingWebSocketSession in project spring-framework by spring-projects.

the class OrderedMessageSendingIntegrationTests method setup.

@BeforeEach
public void setup() {
    this.blockingSession = new BlockingWebSocketSession();
    this.blockingSession.setId("1");
    this.blockingSession.setOpen(true);
    this.executor = new ThreadPoolTaskExecutor();
    this.executor.setCorePoolSize(Runtime.getRuntime().availableProcessors() * 2);
    this.executor.setAllowCoreThreadTimeOut(true);
    this.executor.afterPropertiesSet();
    this.subscribableChannel = new ExecutorSubscribableChannel(this.executor);
    OrderedMessageChannelDecorator.configureInterceptor(this.subscribableChannel, true);
    this.orderedMessageChannel = new OrderedMessageChannelDecorator(this.subscribableChannel, logger);
}
Also used : ExecutorSubscribableChannel(org.springframework.messaging.support.ExecutorSubscribableChannel) BlockingWebSocketSession(org.springframework.web.socket.handler.BlockingWebSocketSession) OrderedMessageChannelDecorator(org.springframework.messaging.simp.broker.OrderedMessageChannelDecorator) ThreadPoolTaskExecutor(org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

BeforeEach (org.junit.jupiter.api.BeforeEach)1 OrderedMessageChannelDecorator (org.springframework.messaging.simp.broker.OrderedMessageChannelDecorator)1 ExecutorSubscribableChannel (org.springframework.messaging.support.ExecutorSubscribableChannel)1 ThreadPoolTaskExecutor (org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor)1 BlockingWebSocketSession (org.springframework.web.socket.handler.BlockingWebSocketSession)1