MQTT Preread#
Enables extracting client IDs and usernames
from CONNECT packets for Message Queuing Telemetry Transport (MQTT)
versions
3.1.1
and
5.0.
When building from the source code, the module isn't built
by default; it must be enabled with the build option
--with-stream_mqtt_preread_module.
In packages and images from our repositories, the
module is included in the build. Controls extracting information from For detailed description of value semantics,
see the MQTT protocol specification versions
3.1.1
and 5.0. Unique client identifier. Optional username.Configuration Example#
Choosing a server in a group by client ID:#
stream {
mqtt_preread on;
upstream mqtt {
hash $mqtt_preread_clientid;
# ...
}
}
Directives#
mqtt_preread#
CONNECT packets
during the
preread phase.
If the parameter is enabled (on),
the variables listed below are populated
in the context where it is specified.Built-in Variables#
$mqtt_preread_clientid#$mqtt_preread_username#