ltm rule command MQTT clean session
iRule(1) BIG-IP TMSH Manual iRule(1)
MQTT::clean_session
Get or set clean_session flag of MQTT CONNECT message.
SYNOPSIS
MQTT::clean_session ('0' | '1')?
DESCRIPTION
This command can be used to get or set clean_session flag of MQTT message. This command is valid only for
following MQTT message types:
CONNECT
Syntax
MQTT::clean_session [ 0 | 1 ]
MQTT::clean_session
* Get the clean_session flag of MQTT CONNECT message.
MQTT::clean_session 0
* Clear the clean_session flag of MQTT CONNECT message.
MQTT::clean_session 1
* Set the clean_session flag of MQTT CONNECT message.
RETURN VALUE
When called without an argument, this command returns the clean_session flag of MQTT CONNECT message.
VALID DURING
MQTT_CLIENT_INGRESS MQTT_SERVER_INGRESS MQTT_CLIENT_DATA MQTT_SERVER_DATA MQTT_CLIENT_EGRESS
MQTT_SERVER_EGRESS
EXAMPLES
# Convert non-clean-session connections to clean-session connections
when MQTT_CLIENT_INGRESS {
set type [MQTT::type]
switch $type {
"CONNECT" {
if { [MQTT::clean_session] == 1} {
MQTT::clean_session 0
}
}
}
}
HINTS
SEE ALSO
CHANGE LOG
@BIGIP-13.0.0 --First introduced the command.
BIG-IP 2020-06-23 iRule(1)