Inconsistent Message Distribution with Shared Subscriptions in HiveMQ CE on Kubernetes

I’m using HiveMQ CE (latest version) on Kubernetes and attempting to implement the shared subscription feature as per HiveMQ documentation with the paho.mqtt.golang library.
When scaling my service, I observe irregular message distribution. Instead of an expected round-robin distribution, only a fraction of my services receive a significant amount of data (~2-3k msg/s), while others barely get messages (~0-10 msg/s). For instance, only 2 out of 3 or 3 out of 5 or 3 out of 7 services receive the bulk of messages.

Any insights would be appreciated.


Hello @FLinnenberg ,

First off, welcome to the HiveMQ Community Forum! We are always happy to see new users.

The first thing I would like to note is that message distribution is typically designed in such a way as to minimize traffic, and avoid overloading a subscribing client. This typically results in a scenario in which clients that consume messages faster being prioritized for delivery.

As you’ve mentioned this being a HiveMQ Community Edition broker, this should not apply, but it is worth mentioning that if deployed in a clustered environment with multiple HiveMQ broker nodes, there is additional consideration given to reduce intra-cluster traffic which can impact delivery rates to subscribing clients, as well.

WIth that in mind, in order to review further, I’d like to ask for some additional details from your deployment - namely, your broker configuration file, the structure for your shared subscription topic, how these clients are subscribed to this topic, and additional client details, such as their MQTT version, persistence configuration, or any other details you can share. Please bear in mind that information such as usernames, passwords, addresses, or other pieces of information can be obfuscated or removed as necessary.

Aaron from the HiveMQ Team

Hi Aaron,

we use HiveMQ (2023.7) inside Kubernetes, using the following configurations:


<?xml version="1.0"?>

ENV vars:

JAVA_OPTS : -Xmx750m -Xms750m

We alo use the following extensions for this test:

  • hivemq-allow-all-extension
  • hivemq-prometheus-extension
  • hivemq-heartbeat-extension

Our topic looks like is based on our new datamodel (B) Data Modeling in the Unified Namespace: From Topic Hierachies over Payload Schemas to MQTT/Kafka)
And therefore follows this schema: umh/v1/enterprise/site/area/productionLine/workCell/originID/_usecase/tag

Our clients subscribe using:

Where GROUP_ID is generated by SHA256 of the instance serial number.
So that when we scale up our replicas on a single instance, the GROUP_ID is always the same.

The sourcecode of one of our services can be found at: it uses paho.mqtt.golang as it’s MQTT lib.
The libary only supports MQTT 3/3.1

Please let me know if you need any more details.