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_proxy
Configuration (* required)
options
object
The server
specific options.
options:
authorization:
my_jwt_guard:
credentials:
connect:
username: Bearer {credentials}
versions:
- v5
- v3.1.1
options.authorization
object
as map of namedobject
properties
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
array
ofenum
[v3.1.1
,v5
]
Supported protocol versions.
options.topics
array
ofobject
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
object
as map of namedenum
[double
,float
,int32
,int64
,json
,string
],object
as map of namedobject
properties
Enforce validation for user provided properties.
user-properties:
my-app-prop:
model: int32
range: 0-100
user-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*
array
ofobject
Conditional mqtt
specific routes.
routes[].guarded
object
as map of namedarray
ofstring
List of roles required by each named guard to authorize this route.
routes:
- guarded:
my_guard:
- read:items
routes[].when
array
ofobject
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: reply
when[].session
array
ofobject
Array of mqtt session properties
session[].client-id
string
An MQTT client identifier, allowing the usage of wildcards.
when[].publish
array
ofobject
Array of MQTT topic names for publish capability.
publish[].topic
string
The MQTT topic to match on that supports standard MQTT wildcards /+/
, /#
.
when[].subscribe
array
ofobject
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_proxy
exit
string
Default exit binding when no conditional routes are viable.
exit: echo_server
telemetry
object
Defines the desired telemetry for the binding.
telemetry.metrics
array
Telemetry metrics to track
telemetry:
metrics:
- stream.*