add advanced.rst

This commit is contained in:
Feng 2016-10-19 17:46:04 +08:00
parent 65f587b012
commit b09fc575b6
1 changed files with 45 additions and 0 deletions

45
docs/source/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 |
+-----------------+-------------------------------------------+