|
4 | 4 |
|
5 | 5 | This sample uses the
|
6 | 6 | [Message Broker](https://docs.aws.amazon.com/iot/latest/developerguide/iot-message-broker.html)
|
7 |
| -for AWS IoT to send and receive messages through an MQTT connection using MQTT5 using a Shared Subscription. |
| 7 | +for AWS IoT to send and receive messages over a MQTT5 connection using a shared subscription. |
8 | 8 |
|
9 | 9 | MQTT5 introduces additional features and enhancements that improve the development experience with MQTT. You can read more about MQTT5 in the Python V2 SDK by checking out the [MQTT5 user guide](../documents/MQTT5_Userguide.md).
|
10 | 10 |
|
11 | 11 | Note: MQTT5 support is currently in **developer preview**. We encourage feedback at all times, but feedback during the preview window is especially valuable in shaping the final product. During the preview period we may make backwards-incompatible changes to the public API, but in general, this is something we will try our best to avoid.
|
12 | 12 |
|
13 |
| -Shared Subscriptions allow IoT devices to connect to a group where messages sent to a topic are then relayed to the group in a round-robin-like fashion. This is useful for distributing message load across multiple subscribing MQTT5 clients automatically. This is helpful for load balancing when you have many messages that need to processed. |
| 13 | +[Shared Subscriptions](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901250) allow IoT devices to connect to a group where messages sent to a topic are then relayed to the group in a round-robin-like fashion. This is useful for distributing message load across multiple subscribing MQTT5 clients automatically. This is helpful for load balancing when you have many messages that need to be processed. |
14 | 14 |
|
15 |
| -Shared Subscriptions rely on what is called a group identifier, which tells the MQTT5 broker/server which IoT devices are in what group. This is done when subscribing by formatting the subscription topic like the following: `$share/<group identifier>/<topic>`. |
| 15 | +Shared Subscriptions rely on a group identifier, which tells the MQTT5 broker/server which IoT devices to treat as a group for message distribution. This is done when subscribing by formatting the subscription topic like the following: `$share/<group identifier>/<topic>`. |
16 | 16 | * `$share`: Tells the MQTT5 broker/server that the device is subscribing to a Shared Subscription.
|
17 |
| -* `<group identifier>`: Tells the MQTT5 broker/server which group to add this Shared Subscription to. THis is the group of MQTT5 clients that will be worked through as part of the round-robin when a message comes in. For example: `my-iot-group`. |
| 17 | +* `<group identifier>`: Tells the MQTT5 broker/server which group to add this Shared Subscription to. Messages published to a matching topic will be distributed round-robin amongst the group. |
18 | 18 | * `<topic>`: The topic that the Shared Subscription is for. Messages published to this topic will be processed in a round-robin fashion. For example, `test/topic`.
|
19 | 19 |
|
20 |
| -As mentioned, Shared Subscriptions use a round-robbin like method of distributing messages. For example, say you have three MQTT5 clients all subscribed to the same Shared Subscription group and topic. If five messages are sent to the Shared Subscription topic, the messages will likely be delivered in the following order: |
| 20 | +Shared Subscriptions use a round-robbin like method of distributing messages. For example, say you have three MQTT5 clients all subscribed to the same Shared Subscription group and topic. If five messages are sent to the Shared Subscription topic, the messages will likely be delivered in the following order: |
21 | 21 | * Message 1 -> Client one
|
22 | 22 | * Message 2 -> Client two
|
23 | 23 | * Message 3 -> Client three
|
|
0 commit comments