local subscription, shared subscription

This commit is contained in:
Feng 2016-10-19 15:54:00 +08:00
parent d2fbbd32ef
commit 20fd4f4f7e
1 changed files with 45 additions and 0 deletions

45
docs/advanced.rst Normal file
View File

@ -0,0 +1,45 @@
.. _advanced:
========
Advanced
========
*EMQ* 2.0-rc.2 release supports `Local Subscription` and `Shared Subscription`.
------------------
Local Subscription
------------------
The EMQ broker will not create global routes for `Local Subscription`, and only dispatch MQTT messages on local node.
.. code-block:: shell
mosquitto_sub -t '$local/topic'
mosquitto_pub -t 'topic'
Usage: subscribe a topic with `$local/` prefix.
-------------------
Shared Subscription
-------------------
Shared Subscription supports Load balancing to distribute MQTT messages between multiple subscribers in the same group::
---------
| | --Msg1--> Subscriber1
Publisher--Msg1,Msg2,Msg3-->| EMQ | --Msg2--> Subscriber2
| | --Msg3--> Subscriber3
---------
Two ways to create a shared subscription:
+-----------------+-------------------------------------------+
| Prefix | Examples |
+-----------------+-------------------------------------------+
| $queue/ | mosquitto_sub -t '$queue/topic |
+-----------------+-------------------------------------------+
| $share/<group>/ | mosquitto_sub -t '$share/group/topic |
+-----------------+-------------------------------------------+