0

The are several devices connected to RabbitMQ using MQTT protocol and there are many nodejs process subscribed with AMPQ protocol to RabbitMQ to fetch data from those devices.

The devices are publishing with topics structured like this: data.DEVICETYPE.IDDEVICE, for example one nodejs process is subscribed on the topic data.# for getting ALL messages from devices.

My concern is about the separator that, in this case, is the "."; because in all examples and the documentation of the MQTT protocol, they always use "/" (like a path folder) so i started to think that using the point instead of slash could be a problem.

It's worth to mention that the system actually works well, but i really don't know if in the future this decision could rise compatibly problems.

EDIT: Actually my structure is like this: RabbitMQ Topic structure I started from this to create that topic structure.

Alessio Dal Bianco
  • 930
  • 1
  • 11
  • 20

1 Answers1

0

/ is the hierarchy separator in MQTT. If you use . instead, it "works", but you just have a large number of distinct top level topics.

You couldn't subscribe using wildcards using data.# - that is an invalid subscription topic. # must be the last character for a subscription and must be on its own level. As . is not a hierarchy separator you violate this last rule.

ralight
  • 11,033
  • 3
  • 49
  • 59
  • I modified the question, i hope it helps to understand better the structure and why we choose the "." separator. – Alessio Dal Bianco Jun 27 '16 at 15:32
  • As Roger says, using . means you can't take advantage of the wildcard subscriptions in Topic Filters. The mqtt man page from Mosquitto has a good description of them: http://mosquitto.org/man/mqtt-7.html – njh Jun 27 '16 at 16:22
  • 1
    Actually i read that RabbitMQ perform a conversion from "/" to "." . See there https://groups.google.com/forum/#!searchin/rabbitmq-users/mqtt$20amqp$20topic/rabbitmq-users/_WEGGpOrgzs/6DZgWIApM4oJ for matching AMQP filters. – Alessio Dal Bianco Jun 28 '16 at 06:47