Mqtt binder for spring cloud stream
This section contains the configuration options used by the Apache Kafka binder.
For common configuration options and properties pertaining to binder, see the core documentation.
- spring.cloud.stream.mqtt.binder.url
-
location of the mqtt broker(s) (comma-delimited list)
Default:
tcp://localhost:1883
. - spring.cloud.stream.mqtt.binder.username
-
the username to use when connecting to the broker
Default:
guest
. - spring.cloud.stream.mqtt.binder.password
-
the password to use when connecting to the broker
Default:
guest
. - spring.cloud.stream.mqtt.binder.cleanSession
-
whether the client and server should remember state across restarts and reconnects
Default:
true
. - spring.cloud.stream.mqtt.binder.connectionTimeout
-
the connection timeout in seconds
Default:
30
. - spring.cloud.stream.mqtt.binder.keepAliveInterval
-
the ping interval in seconds
Default:
60
. - spring.cloud.stream.mqtt.binder.persistence
-
memory' or 'file'
Default:
true
. - spring.cloud.stream.mqtt.binder.persistenceDirectory
-
Persistence directory
Default:
/tmp/paho
.
Note
|
To avoid repetition, Spring Cloud Stream supports setting values for all channels, in the format of spring.cloud.stream.default.<property>=<value> .
|
The following properties are available for Mqtt consumers only and
must be prefixed with spring.cloud.stream.mqtt.bindings.<channelName>.consumer.
.
- clientId
-
identifies the client
Default:
stream.client.id.source
. - topics
-
the topic(s) (comma-delimited) to which the source will subscribe
Default:
stream.mqtt
. - qos
-
the qos; a single value for all topics or a comma-delimited list to match the topics
Default:
0
. - binary
-
true to leave the payload as bytes
Default:
false
. - charset
-
the charset used to convert bytes to String (when binary is false)
Default:UTF-8
.
Note
|
To avoid repetition, Spring Cloud Stream supports setting values for all channels, in the format of spring.cloud.stream.default.<property>=<value> .
|
The following properties are available for Mqtt producers only and
must be prefixed with spring.cloud.stream.mqtt.bindings.<channelName>.producer.
.
- clientId
-
identifies the client
Default:
stream.client.id.source
. - topic
-
the topic to which the sink will publish
Default:
stream.mqtt
. - qos
-
the quality of service to use
Default:
1
. - retained
-
whether to set the 'retained' flag
Default:
false
. - charset
-
the charset used to convert bytes to String (when binary is false)
Default:UTF-8
. - async
-
whether or not to use async sends
Default:
false
.