|
6.
|
|
|
This manual describes some of the features of mqtt version 3.1, to assist end users in getting the most out of it. For more complete information on mqtt, see <uri type="webpage">http://mqtt.org/</uri>.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
mqtt.7.xml:27(para)
|
|
7.
|
|
|
Publish/Subscribe
|
|
|
|
Pubblica/Sottoscrivi
|
|
Translated and reviewed by
Guybrush88
|
|
|
|
Located in
mqtt.7.xml:34(title)
|
|
8.
|
|
|
The mqtt protocol is based on the principle of publishing messages and subscribing to topics, or "pub/sub". Multiple clients connect to a broker and subscribe to topics that they are interested in. Clients also connect to the broker and publish messages to topics. Many clients may subscribe to the same topics and do with the information as they please. The broker and mqtt act as a simple, common interface for everything to connect to. This means that you if you have clients that dump subscribed messages to a database, to twitter, pachube or even a simple text file, then it becomes very simple to add new sensors or other data input to a database, twitter or so on.
|
|
|
|
(no translation yet)
|
|
|
|
Located in
mqtt.7.xml:35(para)
|
|
9.
|
|
|
Topics/Subscriptions
|
|
|
|
Argomenti/Sottoscrizioni
|
|
Translated and reviewed by
Guybrush88
|
|
|
|
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
|
|
|
|
sensori/NOME_COMPUTER/temperature/NOME_DISCORIGIDO
|
|
Translated and reviewed by
Guybrush88
|
|
|
|
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/+
|
|
|
|
sensori/+/temperatura/+
|
|
Translated and reviewed by
Guybrush88
|
|
|
|
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)
|