Dynamic Topic Routing: Efficient Data Distribution in MQTT-Based IoT Systems

52 views
Skip to first unread message

Elona Homes

unread,
Apr 9, 2024, 6:50:57 AMApr 9
to MQTT
Hi folks,

I am using MQTT broker in a scenario in which the broker gets the data through a topic say location/officespace/floor/home where has the payload consists of an xml/json consisting the data and the status of home and there is a subscriber who wants to subscribe to specific topic in the home ( say fan, ac, bulb, etc). Is there any possible way where the broker can redirect to these topics from the payload it received?

In Brief:  I want to know if there is any feature in broker where it can publish the message to a topic, generated by using the payload received...
Ex: 
>>Topic published to the broker : location/officespace/floor/home
>>payload received : components{
                                          room{  [
                                                        fan{
                                                             status: off
                                                              speed: value
                                                             }
                                                          ] 
                                                       }

>>Topic to send to subscriber :  location/officespace/floor/home/fan

Thanks in Advance

Best,
E

Andy Stanford-Clark

unread,
Apr 9, 2024, 7:01:01 AMApr 9
to 'Simon Walters' via MQTT
MQTT does not do “content-based routing”, which some messaging systems can do.

My suggestions would be either
1) have an application which subscribes to everything, examines the payloads and republishes to an “appliance” topic tree for subscribers to access
or 
2) include some additional “tags” in the published topic to indicate what is in the payload (e.g. ocation/officespace/floor/home/fan

Andy

--
To learn more about MQTT see https://mqtt.org
---
You received this message because you are subscribed to the Google Groups "MQTT" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mqtt+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mqtt/df04d750-e5da-4466-a6a7-c45527173e2an%40googlegroups.com.

Ranjith Kumar Diraviyam

unread,
May 5, 2024, 11:29:40 PMMay 5
to MQTT
Most of the Platforms has rules based on the topics. However not based on the Payload. 

You can choose MQTT Broker with Extendability like Bevywise MQTTRoute which has the option to extend and write your own algorithm.   

You can parse the payload and then send it to the respective client via the pre defined topics. 
Reply all
Reply to author
Forward
0 new messages