Преглед изворни кода

local subscription, shared subscription

Feng пре 9 година
родитељ
комит
20fd4f4f7e
1 измењених фајлова са 45 додато и 0 уклоњено
  1. 45 0
      docs/advanced.rst

+ 45 - 0
docs/advanced.rst

@@ -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      |
++-----------------+-------------------------------------------+
+