You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to MQTT
All new to MQTT and I have question it seams hard to find a answer to. Is there any support to map sensor topics to a more logic topic after installation?
Say you install a bunch of temperature sensors in a couple of buildings (and keep track of which sensor installed where). When publishing temperatures this will be done under the sensor ID (MAC/serial). But at the end I would like to be able to subscribe to "block7/house1/temp/flat123" all without having to compiling this string into the source code of the sensor. I read one post (somewhere else) solving this by having a application subscribing to all topics (numeric MAC/serial) and the re-publish the data with a new topic string. But I thought there might be a "built in" mechanism/approach for this, or?
/M
Nicholas J Humfrey
unread,
Mar 13, 2016, 3:05:17 PM3/13/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to mq...@googlegroups.com
Hi Micke,
I guess it is possible that a MQTT Server implementation could have
support for re-mapping topics built-in but it isn't a feature of the
MQTT protocol itself.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to MQTT
I have seen this done three different ways, all of which use some logic outside the mqtt spec and your milage will vary based on the message broker you use.
1) as mentioned earlier, create a re-publisher that listens to a list of mqtt topics (or a wildcard) and then republishes to a different set of mqtt topics based on a lookup table.
2) use mqtt topics for publishing of the sensor data and then use topic to queue bridging to map those topics into more logical queues on the message broker. Of course this only works if you use a multi-protocol message broker because mqtt does not support queues. Also your subscribers now have to use JMS or AMQP or some other non-mqtt API or wireline protocol that supports queues.
3) use a subscription manager application with administrative hooks into the mqtt broker to watch for mqtt subscriptions to "block7/house1/temp/flat123" and remap those subscription requests into subscriptions to "MAC/serial". This requires the mqtt broker to expose an admin API which (again) is not part of the mqtt spec.
-hans
Laing, Michael
unread,
Mar 13, 2016, 5:11:07 PM3/13/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message