|
9.
|
|
|
Topics/Subscriptions
|
|
|
|
(no translation yet)
|
|
|
|
Located in
mqtt.7.xml:48(title)
|
|
10.
|
|
|
Messages in mqtt are published on topics. There is no need to configure a topic, publishing on it is enough. Topics are treated as a hierarchy, using a slash (/) as a separator. This allows sensible arrangement of common themes to be created, much in the same way as a filesystem. For example, multiple computers may all publish their hard drive temperature information on the following topic, with their own computer and hard drive name being replaced as appropriate:
|
|
|
|
(no translation yet)
|
|
|
|
Located in
mqtt.7.xml:49(para)
|
|
11.
|
|
|
sensors/COMPUTER_NAME/temperature/HARDDRIVE_NAME
|
|
|
|
(no translation yet)
|
|
|
|
Located in
mqtt.7.xml:57(listitem)
|
|
12.
|
|
|
Clients can receive messages by creating subscriptions. A subscription may be to an explicit topic, in which case only messages to that topic will be received, or it may include wildcards. Two wildcards are available, <option>+</option> or <option>#</option>.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
mqtt.7.xml:59(para)
|
|
13.
|
|
|
<option>+</option> can be used as a wildcard for a single level of hierarchy. It could be used with the topic above to get information on all computers and hard drives as follows:
|
|
|
|
(no translation yet)
|
|
|
|
Located in
mqtt.7.xml:63(para)
|
|
14.
|
|
|
sensors/+/temperature/+
|
|
|
|
(no translation yet)
|
|
|
|
Located in
mqtt.7.xml:67(listitem)
|
|
15.
|
|
|
As another example, for a topic of "a/b/c/d", the following example subscriptions will match:
|
|
|
|
(no translation yet)
|
|
|
|
Located in
mqtt.7.xml:69(para)
|
|
16.
|
|
|
a/b/c/d
|
|
|
|
(no translation yet)
|
|
|
|
Located in
mqtt.7.xml:72(para) mqtt.7.xml:89(para)
|
|
17.
|
|
|
+/b/c/d
|
|
|
|
(no translation yet)
|
|
|
|
Located in
mqtt.7.xml:73(para)
|
|
18.
|
|
|
a/+/c/d
|
|
|
|
(no translation yet)
|
|
|
|
Located in
mqtt.7.xml:74(para)
|