Skip to content

Latest commit

 

History

History
33 lines (18 loc) · 1.5 KB

File metadata and controls

33 lines (18 loc) · 1.5 KB

MQTT Consumer

A consumer that allows you to send messages using the MQTT protocol.

Beans for injection

The MqttConsumerConfiguration auto-configuration provides the following bean:

Consumer<Message<?>> mqttConsumer

You can use mqttConsumer as a qualifier when injecting.

Configuration Options

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.

SSL Configuration

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.

Tests

See this test suite for the various ways, this consumer is used.

Other usage

See this README where this consumer is used to create a Spring Cloud Stream application where it makes a MQTT sink.