Example usage for org.springframework.integration.mqtt.outbound MqttPahoMessageHandler setAsync

List of usage examples for org.springframework.integration.mqtt.outbound MqttPahoMessageHandler setAsync

Introduction

In this page you can find the example usage for org.springframework.integration.mqtt.outbound MqttPahoMessageHandler setAsync.

Prototype

public void setAsync(boolean async) 

Source Link

Document

Set to true if you don't want to block when sending messages.

Usage

From source file:org.springframework.integration.samples.mqtt.Application.java

@Bean
public MessageHandler mqttOutbound() {
    MqttPahoMessageHandler messageHandler = new MqttPahoMessageHandler("siSamplePublisher",
            mqttClientFactory());//from w  w w .ja  v  a2 s.c om
    messageHandler.setAsync(true);
    messageHandler.setDefaultTopic("siSampleTopic");
    return messageHandler;
}