Hi Dimitar,
That's an excellent question about IoT Hub's MQTT broker limitations )) it's really important to understand what you're working with when building IoT solutions. When Microsoft says IoT Hub isn't a full-featured MQTT broker, they mean it implements a specific subset of the MQTT protocol that's optimized for device-to-cloud and cloud-to-device messaging, rather than providing all the features you'd expect from a general-purpose MQTT broker like Mosquitto or HiveMQ.
IoT Hub doesn't support the full range of MQTT quality of service levels. While it handles QoS 0 and QoS 1 for message delivery, it doesn't implement QoS 2, which involves a four-step handshake process. This is because Azure's durable messaging system provides similar guarantees through other mechanisms.
The retain message feature from MQTT spec isn't supported. In a full broker, retained messages stay on the broker and get delivered to new subscribers immediately when they connect. IoT Hub handles this differently through its own message routing and processing.
Wildcard subscriptions work differently. While IoT Hub supports basic wildcards in topic filters, it doesn't support the full range of MQTT wildcard patterns that a complete broker would handle.
Session state management is limited. Full MQTT brokers maintain client sessions across disconnections, but IoT Hub has its own connection state management that's optimized for scale rather than strict MQTT compliance.
The IoT Hub MQTT support documentation explains these specific protocol implementations https://free.blessedness.top/en-us/azure/iot-hub/iot-hub-mqtt-support.
Another limitation is that IoT Hub doesn't support the full MQTT bridge protocol for connecting multiple brokers together. Instead, you'd use Azure IoT Edge or other Azure services to create distributed IoT architectures.
The reason for these limitations is that IoT Hub is designed as a cloud-scale telemetry ingestion service first, and an MQTT broker second. The features they've implemented are the ones most commonly needed for IoT scenarios while maintaining the service's reliability and scalability.
For most IoT applications, the supported MQTT features are perfectly adequate. But if you need full MQTT v3.1.1 compliance for legacy systems or specific use cases, you might want to consider putting a dedicated MQTT broker in front of IoT Hub using Azure Container Instances or Azure VMs.
regards,
Alex
and "yes" if you would follow me at Q&A - personaly thx.
P.S. If my answer help to you, please Accept my answer