Why VerneMQ service is not load balancing

My VerneMQ config:

allow_multiple_sessions = on
queue_deliver_mode = balance

My Kafka connects:
1 connector with 12 tasks that sink msg to VerneMQ
When it show all sessions I see that VerneMQ service is not load balancing, too many services are directed to the Node vernemq-sqa-2.svc.cluster.local

bash-5.1$ vmq-admin session show --node --client_id --limit=12000   --is_online | grep true | grep -v AP_
| iot_inventory_id          | true      | VerneMQ*@example*-vernemq-sqa-1.svc.cluster.local |
| ap_heartbeat_incomming    | true      | VerneMQ*@example*-vernemq-sqa-2.svc.cluster.local |
| wlan_ap_incoming          | true      | VerneMQ*@example*-vernemq-sqa-2.svc.cluster.local |
| iot_enforcement_id        | true      | VerneMQ*@example*-vernemq-sqa-2.svc.cluster.local |
| wlan_ap_outgoing          | true      | VerneMQ*@example*-vernemq-sqa-2.svc.cluster.local |
| wlan_ap_outgoing          | true      | VerneMQ*@example*-vernemq-sqa-2.svc.cluster.local |
| wlan_ap_outgoing          | true      | VerneMQ*@example*-vernemq-sqa-2.svc.cluster.local |
| wlan_ap_outgoing          | true      | VerneMQ*@example*-vernemq-sqa-2.svc.cluster.local |
| wlan_ap_outgoing          | true      | VerneMQ*@example*-vernemq-sqa-2.svc.cluster.local |
| wlan_ap_outgoing          | true      | VerneMQ*@example*-vernemq-sqa-1.svc.cluster.local |
| wlan_ap_outgoing          | true      | VerneMQ*@example*-vernemq-sqa-2.svc.cluster.local |
| wlan_ap_outgoing          | true      | VerneMQ*@example*-vernemq-sqa-1.svc.cluster.local |
| wlan_ap_outgoing          | true      | VerneMQ*@example*-vernemq-sqa-2.svc.cluster.local |
| wlan_ap_outgoing          | true      | VerneMQ*@example*-vernemq-sqa-1.svc.cluster.local |
| wlan_ap_outgoing          | true      | VerneMQ*@example*-vernemq-sqa-2.svc.cluster.local |
| wlan_ap_outgoing          | true      | VerneMQ*@example*-vernemq-sqa-2.svc.cluster.local |
1 Like

@70G37H3R allow_multiple_sessions is not a supported Verne feature anymore. (Well, technically, it’s still in there but deprecated).
It created too many issues. Note that allow_multiple_sessions is a single-node feature.
You need to replace your approach by using the shared subscription feature to load balance the consumer side; and by a load balancing strategy that distributes the publisher at the incoming side of the broker.

All your publishing instances will need to connect with different MQTT ClientIds.

2 Likes

Thank you so much for your supporting!

Wish you have a nice day

2 Likes