...
Div |
---|
class | confluenceTableSmall |
---|
|
Option | Default | Description |
---|
clientId | camel-<timestamp> | MQTT client identifier. | brokerUrl
| tcp://localhost:1883
| The URL of the MQTT broker. | persistence | memory | Client persistence to be used - memory or file . | qos | 2 | Client quality of service level (0 -2 ). | connectOptions | none | The reference to the org.eclipse.paho.client.mqttv3.MqttConnectOptions instance located in the Camel registry. Referenced MqttConnectOptions instance will be used by the endpoint to initialize the connection. For example connectOptions=#my ConnectOptions notation can be used to reference Spring bean named my ConnectOptions. If there is only a single instance of the MqttConnectOptions in the registry, it will be automatically picked up by the endpoint. |
|
For example the convention-over-configuration approach used in Camel is really handy for the most of the situations, but sometimes you would like to have more fine-grained control over the MQTT client connection. To cover such situations just add the bean of type org.eclipse.paho.client.mqttv3.MqttConnectOptions
named connectOptions
to to your Camel registry. For Spring applications that would means adding bean to your application context. The snippet below uses password-based authentication to connect to the MQTT broker:
...