Example usage for org.springframework.integration.mqtt.inbound MqttPahoMessageDrivenChannelAdapter setQos

List of usage examples for org.springframework.integration.mqtt.inbound MqttPahoMessageDrivenChannelAdapter setQos

Introduction

In this page you can find the example usage for org.springframework.integration.mqtt.inbound MqttPahoMessageDrivenChannelAdapter setQos.

Prototype

public void setQos(int... qos) 

Source Link

Document

Set the QoS for each topic; a single value will apply to all topics otherwise the correct number of qos values must be provided.

Usage

From source file:org.createnet.raptor.auth.service.Application.java

@Bean
public MessageProducer inbound() {
    MqttPahoMessageDrivenChannelAdapter adapter = new MqttPahoMessageDrivenChannelAdapter("raptorauth",
            mqttClientFactory(), "+/events");
    adapter.setCompletionTimeout(5000);//  w ww  .  jav  a2s.c o  m
    adapter.setConverter(new DefaultPahoMessageConverter());
    adapter.setQos(0);
    adapter.setRecoveryInterval(1000);
    adapter.setOutputChannel(mqttInputChannel());

    return adapter;
}

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

@Bean
public MessageProducerSupport mqttInbound() {
    MqttPahoMessageDrivenChannelAdapter adapter = new MqttPahoMessageDrivenChannelAdapter("siSampleConsumer",
            mqttClientFactory(), "siSampleTopic");
    adapter.setCompletionTimeout(5000);/*from  ww w.  j  av a 2s  .c  om*/
    adapter.setConverter(new DefaultPahoMessageConverter());
    adapter.setQos(1);
    return adapter;
}