org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler Java Examples

The following examples show how to use org.springframework.integration.mqtt.outbound.MqttPahoMessageHandler. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MqttConfig.java    From iot-dc3 with Apache License 2.0 5 votes vote down vote up
@Bean
@ServiceActivator(inputChannel = "mqttOutChannel")
public MessageHandler outbound() {
    MqttPahoMessageHandler messageHandler = new MqttPahoMessageHandler(clientId, mqttClientFactory());
    messageHandler.setAsync(true);
    messageHandler.setDefaultQos(defaultQos);
    messageHandler.setDefaultTopic(defaultTopic);
    return messageHandler;
}
 
Example #2
Source File: MqttSinkConfiguration.java    From mqtt with Apache License 2.0 5 votes vote down vote up
@Bean
@ServiceActivator(inputChannel = Sink.INPUT)
public MessageHandler mqttOutbound() {
	MqttPahoMessageHandler messageHandler = new MqttPahoMessageHandler(properties.getClientId(), mqttClientFactory);
	messageHandler.setAsync(properties.isAsync());
	messageHandler.setDefaultTopic(properties.getTopic());
	messageHandler.setConverter(pahoMessageConverter());
	return messageHandler;
}
 
Example #3
Source File: MqttSourceTests.java    From mqtt with Apache License 2.0 5 votes vote down vote up
@Bean
public MessageHandler mqttOutbound() {
	MqttPahoMessageHandler messageHandler = new MqttPahoMessageHandler("test", mqttClientFactory);
	messageHandler.setAsync(true);
	messageHandler.setDefaultTopic("test");
	messageHandler.setConverter(pahoMessageConverter());
	return messageHandler;
}