Rumqttd now supports MQTTv5 topic alias and message expiry
rumqttd, your favorite and blazingly fast broker, is now one step closer to full fledged MQTTv5 support. It now supports features like topic aliases and message expiry! pretty cool right? Lets go over what those features are and why to use them.
Topic Alias
Let's say you are continuously publishing some data on a/very/looong/topic/name
. You have to include topic name in every Publish packet, which increases the size of packet. But what if you could just publish packet on topic 5
and broker will understand what to do with it? that's exactly what topic alias does!
With topic alias support, you can set alias for topic name with a unsigned integer value, and then use that alias for subsequent publishes. This reduces the network bandwidth consumption. Check out this example to see how to use topic aliases with rumqttc.
Broker can also set alias, if supported by client. If max_topic_alias
is provided by client during connection, broker assumes that client supports ( and wants ) to use topic aliases.
Message Expiry
In real world, information can become irrelevant after certain time, and thus, should be discarded. That is where message expiry come into action.
Publisher can set a message-expiry-interval
while publishing the packet. If broker doesn't start processing the packet before message-expiry-interval
, it will be discarded. This also prevents clients from getting lots of publish packet on reconnection, which contains irrelevant ( expired ) information.
What's next?
Other MQTTv5 related features like subscription groups, session expiry, etc. are planned and should be there soon. If you want to keep track of it, or if yo haven't already, star rumqtt on GitHub. We will meet again soon with new feature announcement, till then, please try out topic alias and message expiry and let us know the feedback. Feel free to open issues / PR if required.