MQTT support for responder
-
DROP
-
RESET
-
NOOP
-
A responder action to initiate a new MQTT CONNACK response.
Configuring responder policies for MQTT
-
MQTT_REQ_DEFAULT
-
MQTT_REQ_OVERRIDE
-
MQTT_JUMBO_REQ_DEFAULT
-
MQTT_JUMBO_REQ_OVERRIDE
-
REQUEST
-
MQTT_JUMBO_REQ (this bind point is used only for Jumbo packets)
To configure the responder to respond to an MQTT request by using CLI
add responder action <actName> <actType>
-
For
actname, substitute a name for your new action. The name can be 1–127 characters in length, and can contain letters, numbers, hyphen (-), and underscore (_) symbols. -
For
actType, substitute a responder action type, respondwith.
add responder action mqtt_connack_unsup_ver respondwith MQTT.NEW_CONNACK(132)
add responder policy <polName> <rule> <actname>
-
For
polname, substitute a name for your new policy. -
For
actname, substitute the name of the action that you created.
add responder policy reject_lower_version "MQTT.HEADER.COMMAND.EQ(CONNECT) && MQTT.VERSION.LT(3)" mqtt_connack_unsup_ver
bind lb vserver <name> -policyName <policy_name> -priority <priority>
bind cs vserver <name> -policyName <policy_name> -priority <priority>
-
For
policy_name, substitute the name of the policy that you have created. -
For
priority, specify the priority of the policy.
bind lb vserver lb1 -policyName reject_lower_version -priority 50
bind cs vserver mqtt_frontend_cs -policyName reject_lower_version -priority 5
Use case1: Filter clients based on the user name or client ID
Sample configuration for filtering clients based on the client ID
add policy patset filter_clients
bind policy patset filter_clients client1
add responder action mqtt_connack_invalid_client respondwith MQTT.NEW_CONNACK(2)
add responder policy reject_clients "MQTT.HEADER.COMMAND.EQ(CONNECT) && mqtt.connect.clientid.equals_any(\"filter_clients\")" mqtt_connack_invalid_client
bind cs vserver mqtt_frontend_cs -policyName reject_clients -priority 5
Use case2: Limit the maximum message length of MQTT messages to handle jumbo packets
-
MQTT.MESSAGE_LENGTH
-
MQTT.COMMAND
-
MQTT.FROM_CLIENT
-
MQTT.FROM_SERVER
Sample configuration for limiting the maximum message length of MQTT messages
set lb parameter -dropmqttjumbomessage no
add responder policy drop_large_message MQTT.MESSAGE_LENGTH.GT(100000) reset
bind cs vserver mqtt_frontend_cs -policyName drop_large_message -priority 10
dropmqttjumbomessage parameter is set to NO. Therefore, the ADC appliance processes the messages with length greater than 64,000 bytes and less than 1,00,000 bytes. The messages with length greater than 1,00,000 bytes are reset.