A consumer that allows you to send messages using the MQTT protocol.
The MqttConsumerConfiguration
auto-configuration provides the following bean:
Consumer<Message<?>> mqttConsumer
You can use mqttConsumer
as a qualifier when injecting.
All configuration properties are prefixed with mqtt.consumer
.
For more information on the various options available, please see MqttConsumerProperties.
A ComponentCustomizer<MqttPahoMessageHandler>
bean can be added in the target project to provide any custom options for the MqttPahoMessageHandler
configuration used by the mqttConsumer
.
The MQTT Paho client can accept an SSL configuration via MqttConnectOptions.setSSLProperties()
.
These properties are exposed on the MqttProperties.sslProperties
map.
The keys for these SSL properties should be taken from the org.eclipse.paho.client.mqttv3.internal.security.SSLSocketFactoryFactory
constants, which all start with the com.ibm.ssl.
prefix.
See this test suite for the various ways, this consumer is used.
See this README where this consumer is used to create a Spring Cloud Stream application where it makes a MQTT sink.