This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | |||
tut:mqtt [2018-07-20 18:27] jk |
tut:mqtt [2018-07-20 18:31] (current) jk |
||
---|---|---|---|
Line 12: | Line 12: | ||
Based on this image the following examples can show typical data flows | Based on this image the following examples can show typical data flows | ||
- | ==== Example: 1 Publisher, no Subscriper ==== | + | ==== Example: 1 Publisher, no Subscriber ==== |
* Client X connected | * Client X connected | ||
Line 22: | Line 22: | ||
(Exception: see Topics with Retain Flag) | (Exception: see Topics with Retain Flag) | ||
- | ==== Example: 1 Publisher, 1 Subscriper ==== | + | ==== Example: 1 Publisher, 1 Subscriber ==== |
* Client A connected | * Client A connected | ||
Line 31: | Line 31: | ||
If Client A publishes any data with Topic 2 and Client B is notified instantly about change of Topic 2. | If Client A publishes any data with Topic 2 and Client B is notified instantly about change of Topic 2. | ||
- | ==== Example: Many Publisher, Many Subscriper ==== | + | ==== Example: Many Publisher, Many Subscriber ==== |
* Client A, C, E connected | * Client A, C, E connected | ||
Line 39: | Line 39: | ||
{{ :tut:mqtt:mqtt3.svg?600x0 }} | {{ :tut:mqtt:mqtt3.svg?600x0 }} | ||
- | Any Client can publish any data with any Topic at anytime. The subscriping Clients are notified instantly about change of the Topics they subscripes and only that. | + | Any Client can publish any data with any Topic at anytime. The subscribing Clients are notified instantly about change of the Topics they subscripes and only that. |
- | ==== Example: Many Publisher, 1 Subscriper with Wildcard ==== | + | ==== Example: Many Publisher, 1 Subscriber with Wildcard ==== |
* Client A, C, E connected | * Client A, C, E connected | ||
Line 57: | Line 57: | ||
{{ :tut:mqtt:mqtt5.svg?600x0 }} | {{ :tut:mqtt:mqtt5.svg?600x0 }} | ||
- | Every Client can be publisher and subscriper. For sneding a request/command one Topic can be used. For the answer an other Topic is used. | + | Every Client can be publisher and subscriber. For sneding a request/command one Topic can be used. For the answer an other Topic is used. |
Note: This can be solved with only one Tpoic but the publisher would receive his own request/command. | Note: This can be solved with only one Tpoic but the publisher would receive his own request/command. | ||
Line 77: | Line 77: | ||
|2|garantee that data arrives only once| | |2|garantee that data arrives only once| | ||
- | Note: Each publisher and each subscriper can user the QoS flag without affecting the others. | + | Note: Each publisher and each subscriber can user the QoS flag without affecting the others. |
==== Example: Remain-Flag ==== | ==== Example: Remain-Flag ==== | ||
Line 122: | Line 122: | ||
==== Exact Match ==== | ==== Exact Match ==== | ||
- | On subscriping **"/MyHome/Kitchen/Temperature"** you get: | + | On subscribing **"/MyHome/Kitchen/Temperature"** you get: |
* **/MyHome/Kitchen/Temperature** | * **/MyHome/Kitchen/Temperature** | ||
* <del>/MyHome/Kitchen/Humity</del> | * <del>/MyHome/Kitchen/Humity</del> | ||
Line 133: | Line 133: | ||
==== # Wildcard ==== | ==== # Wildcard ==== | ||
- | On subscriping **"/#"** you get: | + | On subscribing **"/#"** you get: |
* /MyHome/Kitchen/Temperature | * /MyHome/Kitchen/Temperature | ||
* /MyHome/Kitchen/Humity | * /MyHome/Kitchen/Humity | ||
Line 142: | Line 142: | ||
* /MyGarden/Pool/Temperature | * /MyGarden/Pool/Temperature | ||
- | On subscriping **"/MyHome/#"** you get: | + | On subscribing **"/MyHome/#"** you get: |
* **/MyHome/**Kitchen/Temperature | * **/MyHome/**Kitchen/Temperature | ||
* **/MyHome/**Kitchen/Humity | * **/MyHome/**Kitchen/Humity | ||
Line 151: | Line 151: | ||
* <del>/MyGarden/Pool/Temperature</del> | * <del>/MyGarden/Pool/Temperature</del> | ||
- | On subscriping **"/MyHome/Kitchen/#"** you get: | + | On subscribing **"/MyHome/Kitchen/#"** you get: |
* **/MyHome/Kitchen/**Temperature | * **/MyHome/Kitchen/**Temperature | ||
* **/MyHome/Kitchen/**Humity | * **/MyHome/Kitchen/**Humity | ||
Line 162: | Line 162: | ||
==== + Wildcard ==== | ==== + Wildcard ==== | ||
- | On subscriping **"/MyHome/+/Temperature"** you get: | + | On subscribing **"/MyHome/+/Temperature"** you get: |
* **/MyHome/**Kitchen**/Temperature** | * **/MyHome/**Kitchen**/Temperature** | ||
* <del>/MyHome/Kitchen/Humity</del> | * <del>/MyHome/Kitchen/Humity</del> | ||
Line 171: | Line 171: | ||
* <del>/MyGarden/Pool/Temperature</del> | * <del>/MyGarden/Pool/Temperature</del> | ||
- | On subscriping **"/+/+/Temperature"** you get: | + | On subscribing **"/+/+/Temperature"** you get: |
* /MyHome/Kitchen**/Temperature** | * /MyHome/Kitchen**/Temperature** | ||
* <del>/MyHome/Kitchen/Humity</del> | * <del>/MyHome/Kitchen/Humity</del> | ||
Line 180: | Line 180: | ||
* /MyGarden/Pool**/Temperature** | * /MyGarden/Pool**/Temperature** | ||
- | On subscriping **"/+/+/+/Temperature"** you get: | + | On subscribing **"/+/+/+/Temperature"** you get: |
* <del>/MyHome/Kitchen/Temperature</del> | * <del>/MyHome/Kitchen/Temperature</del> | ||
* <del>/MyHome/Kitchen/Humity</del> | * <del>/MyHome/Kitchen/Humity</del> |