ltm rule command MQTT keep aliveΒΆ

iRule(1)					  BIG-IP TMSH Manual					     iRule(1)

MQTT::keep_alive
       Get or set keep_alive field of MQTT CONNECT message.

SYNOPSIS
       MQTT::keep_alive (KEEP_ALIVE)?

DESCRIPTION
       This command can be used to get or set keep_alive field of MQTT message.  This command is valid only for
       following MQTT message types:

	   CONNECT

       Syntax

       MQTT::keep_alive [  ]

       MQTT::keep_alive
	   * Get the keep_alive field of MQTT CONNECT message.

       MQTT::keep_alive 
	   * Set the keep_alive field of MQTT CONNECT message to specified number.
	     The number must be smaller than 65536.

RETURN VALUE
       When called without an argument, this command returns the keep_alive field 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
	# Increase keep-alive to at least 60 seconds
	when MQTT_CLIENT_INGRESS {
	   set type [MQTT::type]
	   switch $type {
	       "CONNECT"  {
		   if { [MQTT::keep_alive] < 60} {
		      MQTT::keep_alive 60
		   }
	       }
	   }
	}

HINTS
SEE ALSO
CHANGE LOG
       @BIGIP-13.0.0 --First introduced the command.

BIG-IP						      2020-06-23					     iRule(1)