mqtt server
mqtt server
The mqtt server binding decodes the MQTT protocol on the inbound network stream, producing higher level application streams for each publish or subscribe MQTT topic.
mqtt_server:
type: mqtt
kind: server
options:
authorization:
my_jwt_guard:
credentials:
connect:
username: Bearer {credentials}
versions:
- v5
- v3.1.1
routes:
- when:
- session:
- client-id: "*"
- publish:
- topic: command/one
- topic: command/two
- subscribe:
- topic: reply
exit: mqtt_kafka_proxyConfiguration (* required)
options
object
The server specific options.
options:
authorization:
my_jwt_guard:
credentials:
connect:
username: Bearer {credentials}
versions:
- v5
- v3.1.1options.authorization
objectas map of namedobjectproperties
Authorization by a named guard.
authorization:
my_jwt_guard:
credentials:
connect:
username: Bearer {credentials}authorization.credentials*
object
Defines how to extract credentials from the MQTT connect packet.
credentials.connect*
object
MQTT connect packet properties
connect.username
string
Extract credentials from the MQTT connect packet username property with {credentials}, e.g. "Bearer {credentials}".
connect.password
string
Extract credentials from the MQTT connect packet password property with {credentials}, e.g. "Bearer {credentials}".
options.versions
arrayofenum[v3.1.1,v5]
Supported protocol versions.
options.topics
arrayofobject
Topic configuration.
topics[].name
string
Topic name.
topics[].content
enum[double,float,int32,int64,json,string],object
Enforce validation for content
content.model*
enum[double,float,int32,int64,json,string]
A schema or type to validate the request content. Refer to the individual model docs for type specific implementation.
topics[].user-properties
objectas map of namedenum[double,float,int32,int64,json,string],objectas map of namedobjectproperties
Enforce validation for user provided properties.
user-properties:
my-app-prop:
model: int32
range: 0-100user-properties.model*
enum[double,float,int32,int64,json,string]
A schema or type to validate the user-properties content. Refer to the individual model docs for type specific implementation.
routes*
arrayofobject
Conditional mqtt specific routes.
routes[].guarded
objectas map of namedarrayofstring
List of roles required by each named guard to authorize this route.
routes:
- guarded:
my_guard:
- read:itemsroutes[].when
arrayofobject
List of conditions (any match) to match this route. Read more: When a route matches
routes:
- when:
- session:
- client-id: "*"
- publish:
- topic: command/one
- topic: command/two
- subscribe:
- topic: replywhen[].session
arrayofobject
Array of mqtt session properties
session[].client-id
string
An MQTT client identifier, allowing the usage of wildcards.
when[].publish
arrayofobject
Array of MQTT topic names for publish capability.
publish[].topic
string
The MQTT topic to match on that supports standard MQTT wildcards /+/, /#.
when[].subscribe
arrayofobject
Array of MQTT topic names for subscribe capability.
subscribe[].topic
string
The MQTT topic to match on that supports standard MQTT wildcards /+/, /#.
routes[].exit
string
Next binding when following this route.
routes:
- when:
...
exit: mqtt_kafka_proxyexit
string
Default exit binding when no conditional routes are viable.
exit: echo_servertelemetry
object
Defines the desired telemetry for the binding.
telemetry.metrics
array
Telemetry metrics to track
telemetry:
metrics:
- stream.*
