Example usage for org.springframework.messaging.simp.stomp ReactorNettyTcpStompClient ReactorNettyTcpStompClient

List of usage examples for org.springframework.messaging.simp.stomp ReactorNettyTcpStompClient ReactorNettyTcpStompClient

Introduction

In this page you can find the example usage for org.springframework.messaging.simp.stomp ReactorNettyTcpStompClient ReactorNettyTcpStompClient.

Prototype

public ReactorNettyTcpStompClient(String host, int port) 

Source Link

Document

Create an instance with the given host and port.

Usage

From source file:org.springframework.messaging.simp.stomp.ReactorNettyTcpStompClientTests.java

@Before
public void setUp() throws Exception {

    logger.debug("Setting up before '" + this.testName.getMethodName() + "'");

    int port = SocketUtils.findAvailableTcpPort(61613);

    this.activeMQBroker = new BrokerService();
    this.activeMQBroker.addConnector("stomp://127.0.0.1:" + port);
    this.activeMQBroker.setStartAsync(false);
    this.activeMQBroker.setPersistent(false);
    this.activeMQBroker.setUseJmx(false);
    this.activeMQBroker.getSystemUsage().getMemoryUsage().setLimit(1024 * 1024 * 5);
    this.activeMQBroker.getSystemUsage().getTempUsage().setLimit(1024 * 1024 * 5);
    this.activeMQBroker.start();

    ThreadPoolTaskScheduler taskScheduler = new ThreadPoolTaskScheduler();
    taskScheduler.afterPropertiesSet();/*www . j  a va  2s  .co  m*/

    this.client = new ReactorNettyTcpStompClient("127.0.0.1", port);
    this.client.setMessageConverter(new StringMessageConverter());
    this.client.setTaskScheduler(taskScheduler);
}