You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/iot-operations/create-edge-apps/edge-apps-overview.md
+13-13Lines changed: 13 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,63 +26,63 @@ Both publishers and subscribers should use [QoS-1](https://docs.oasis-open.org/m
26
26
27
27
## Session type and Clean-Session flag
28
28
29
-
To ensure zero message loss, set the [clean-start](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901039) flag to false when connecting to the MQTT broker. This setting informs the broker to maintain the session state for the client, preserving subscriptions and unacknowledged messages between connections. If the client disconnects and later reconnects, it resumes from where it left off, receiving any unacknowledged QoS-1 messages through [message delivery retry](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901238). If configured, IoT MQ expires the client session if the client doesn't reconnect within the *Session Expiry Interval* The default is one day.
29
+
To ensure zero message loss, set the [clean-start](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901039) flag to false when connecting to the MQTT broker. This setting informs the broker to maintain the session state for the client, preserving subscriptions and unacknowledged messages between connections. If the client disconnects and later reconnects, it resumes from where it left off, receiving any unacknowledged QoS-1 messages through [message delivery retry](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901238). If configured, MQTT broker expires the client session if the client doesn't reconnect within the *Session Expiry Interval* The default is one day.
30
30
31
31
## Receive-Max in multithreaded applications
32
32
33
33
Multithreaded applications should use [receive-max](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901049) (65,535 max) to process messages in parallel and apply flow control. This setting optimizes message processing by allowing multiple threads to work on messages concurrently and without the broker overloading the application with a high message rate above the application capacity. Each thread can process a message independently and send its acknowledgment upon completion. A typical practice is to configure *max-receive* proportionally to the number of threads that the application uses.
34
34
35
35
## Acknowledging messages
36
36
37
-
When a subscriber application sends an acknowledgment for a QoS-1 message, it takes ownership of the message. Upon receiving acknowledgment for a QoS-1 message, IoT MQ stops tracking the message for that application and topic. Proper transfer of ownership ensures message preservation in case of processing issues or application crashes. If an application wants to protect it from application crashes, then the application shouldn't take ownership before successfully completing its processing on that message. Applications subscribing to IoT MQ should delay acknowledging messages until processing is complete up to *receive-max* value with a maximum of 65,535. This might include relaying the message, or a derivative of the message, to IoT MQ for further dispatching.
37
+
When a subscriber application sends an acknowledgment for a QoS-1 message, it takes ownership of the message. Upon receiving acknowledgment for a QoS-1 message, MQTT broker stops tracking the message for that application and topic. Proper transfer of ownership ensures message preservation in case of processing issues or application crashes. If an application wants to protect it from application crashes, then the application shouldn't take ownership before successfully completing its processing on that message. Applications subscribing to MQTT broker should delay acknowledging messages until processing is complete up to *receive-max* value with a maximum of 65,535. This might include relaying the message, or a derivative of the message, to MQTT broker for further dispatching.
38
38
39
39
## Message retention and broker behavior
40
40
41
-
The broker retains messages until it receives an acknowledgment from a subscriber, ensuring zero message loss. This behavior guarantees that even if a subscriber application crashes or loses connectivity temporarily, messages won't be lost and can be processed once the application reconnects. IoT MQ messages might expire if configured by the [Message-Expiry-Interval](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901112) and a subscriber didn't consume the message.
41
+
The broker retains messages until it receives an acknowledgment from a subscriber, ensuring zero message loss. This behavior guarantees that even if a subscriber application crashes or loses connectivity temporarily, messages won't be lost and can be processed once the application reconnects. MQTT broker messages might expire if configured by the [Message-Expiry-Interval](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901112) and a subscriber didn't consume the message.
42
42
43
43
## Retained messages
44
44
45
45
[Retained messages](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901104) maintain temporary application state, such as the latest status or value for a specific topic. When a new client subscribes to a topic, it receives the last retained message, ensuring it has the most up-to-date information.
46
46
47
47
## Keep-Alive
48
48
49
-
To ensure high availability in case of connection errors or drops, set suitable [keep-alive intervals](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901045) for client-server communication. During idle periods, clients send *PINGREQs*, awaiting *PINGRESPs*. If no response, implement auto reconnect logic in the client to re-establish connections. Most clients like [Paho](https://www.eclipse.org/paho/) have retry logic built in. As IoT MQ is fault-tolerant, a reconnection succeeds if there is at least two healthy broker instances a frontend and a backend.
49
+
To ensure high availability in case of connection errors or drops, set suitable [keep-alive intervals](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901045) for client-server communication. During idle periods, clients send *PINGREQs*, awaiting *PINGRESPs*. If no response, implement auto reconnect logic in the client to re-establish connections. Most clients like [Paho](https://www.eclipse.org/paho/) have retry logic built in. As MQTT broker is fault-tolerant, a reconnection succeeds if there is at least two healthy broker instances a frontend and a backend.
50
50
51
51
## Eventual consistency with QoS-1 subscription
52
52
53
53
MQTT subscriptions with QoS-1 ensure eventual consistency across identical application instances by subscribing to a shared topic. As messages are published, instances receive and replicate data with at-least-once delivery. The instances must handle duplicates and tolerate temporary inconsistencies until data is synchronized.
54
54
55
55
## Shared subscriptions
56
56
57
-
[Shared subscriptions](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901250) enable load balancing across multiple instances of a highly available application. Instead of each subscriber receiving a copy of every message, the messages are distributed evenly among the subscribers. IoT MQ broker currently only supports a round robin algorithm to distribute messages allowing an application to scale out. A typical use case is to deploy multiple pods using Kubernetes ReplicaSet that all subscribe to IoT MQ using the same topic filter in shared subscription.
57
+
[Shared subscriptions](https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.html#_Toc3901250) enable load balancing across multiple instances of a highly available application. Instead of each subscriber receiving a copy of every message, the messages are distributed evenly among the subscribers. MQTT broker currently only supports a round robin algorithm to distribute messages allowing an application to scale out. A typical use case is to deploy multiple pods using Kubernetes ReplicaSet that all subscribe to MQTT broker using the same topic filter in shared subscription.
58
58
59
-
## Use IoT MQ's built-in key-value store (distributed HashMap)
59
+
## Use MQTT broker's built-in key-value store (distributed HashMap)
60
60
61
-
IoT MQ's built-in key-value store is a simple, replicated in-memory *HashMap* for managing application processing state. Unlike *etcd*, for example, IoT MQ prioritizes high-velocity throughput, horizontal scaling, and low latency through in-memory data structures, partitioning, and chain-replication. It allows applications to use the broker's distributed nature and fault tolerance while accessing a consistent state quickly across instances. To use the built-in key-value store provided by the distributed broker:
61
+
MQTT broker's built-in key-value store is a simple, replicated in-memory *HashMap* for managing application processing state. Unlike *etcd*, for example, MQTT broker prioritizes high-velocity throughput, horizontal scaling, and low latency through in-memory data structures, partitioning, and chain-replication. It allows applications to use the broker's distributed nature and fault tolerance while accessing a consistent state quickly across instances. To use the built-in key-value store provided by the distributed broker:
62
62
63
63
* Implement ephemeral storage and retrieval operations using the broker's key-value store API, ensuring proper error handling and data consistency. Ephemeral state is a short-lived data storage used in stateful processing for fast access to intermediate results or metadata during real-time computations. In the context of HA application, an ephemeral state helps recover application states between crashes. It can be written to disk but remains temporary, as opposed to cold storage that's designed for long-term storage of infrequently accessed data.
64
64
65
65
* Use the key-value store for sharing state, caching, configuration, or other essential data among multiple instances of the application, allowing them to keep a consistent view of the data.
66
66
67
-
## Use IoT MQ's built-in Dapr integration
67
+
## Use MQTT broker's built-in Dapr integration
68
68
69
69
For simpler use cases an application might utilize [Dapr](https://dapr.io) (Distributed Application Runtime). Dapr is an open-source, portable, event-driven runtime that simplifies building microservices and distributed applications. It offers a set of building blocks, such as service-to-service invocation, state management, and publish/subscribe messaging.
70
70
71
-
[Dapr is offered as part of IoT MQ](howto-develop-dapr-apps.md), abstracting away details of MQTT session management, message QoS and acknowledgment, and built-in key-value stores, making it a practical choice for developing a highly available application for simple use cases by:
71
+
[Dapr is offered as part of MQTT broker](howto-develop-dapr-apps.md), abstracting away details of MQTT session management, message QoS and acknowledgment, and built-in key-value stores, making it a practical choice for developing a highly available application for simple use cases by:
72
72
73
-
* Design your application using Dapr's building blocks, such as state management for handling the key-value store, and publish/subscribe messaging for interacting with the MQTT broker. If the use case requires building blocks and abstractions that aren't supported by Dapr, consider using the before mentioned IoT MQ features.
73
+
* Design your application using Dapr's building blocks, such as state management for handling the key-value store, and publish/subscribe messaging for interacting with the MQTT broker. If the use case requires building blocks and abstractions that aren't supported by Dapr, consider using the before mentioned MQTT broker features.
74
74
75
75
* Implement the application using your preferred programming language and framework, leveraging Dapr SDKs or APIs for seamless integration with the broker and the key-value store.
76
76
77
77
## Checklist to develop a highly available application
78
78
79
79
- Choose an appropriate MQTT client library for your programming language. The client should support MQTT v5. Use a C or Rust based library if your application is sensitive to latency.
80
-
- Configure the client library to connect to IoT MQ broker with *clean-session* flag set to false and the desired QoS level (QoS-1).
80
+
- Configure the client library to connect to MQTT broker with *clean-session* flag set to false and the desired QoS level (QoS-1).
81
81
- Decide a suitable value for session expiry, message expiry, and keep-alive intervals.
82
82
- Implement the message processing logic for the subscriber application, including sending an acknowledgment when the message has been successfully delivered or processed.
83
83
- For multithreaded applications, configure the *max-receive* parameter to enable parallel message processing.
84
84
- Utilize retained messages for keeping temporary application state.
85
-
- Utilize IoT MQ built-in key-value store to manage ephemeral application state.
85
+
- Utilize MQTT broker's built-in key-value store to manage ephemeral application state.
86
86
- Evaluate Dapr to develop your application if your use case is simple and doesn't require detailed control over the MQTT connection or message handling.
87
87
- Implement shared subscriptions to distribute messages evenly among multiple instances of the application, allowing for efficient scaling.
88
88
@@ -94,7 +94,7 @@ A northbound application consists of input and output stages, and an optional pr
94
94
95
95

96
96
97
-
To ensure high availability, the input stage connects to IoT MQ and sets the *clean-session* flag to false for persistent sessions, using QoS-1 for reliable message delivery, acknowledging messages post-processing by the output stage. Additionally, the application might use the built-in *HashMap* key-value store for temporary state management and the round robin algorithm to load-balance multiple instances using shared subscriptions.
97
+
To ensure high availability, the input stage connects to MQTT broker and sets the *clean-session* flag to false for persistent sessions, using QoS-1 for reliable message delivery, acknowledging messages post-processing by the output stage. Additionally, the application might use the built-in *HashMap* key-value store for temporary state management and the round robin algorithm to load-balance multiple instances using shared subscriptions.
Copy file name to clipboardExpand all lines: articles/iot-operations/create-edge-apps/howto-deploy-dapr.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
title: Deploy Dapr pluggable components
3
-
description: Deploy Dapr and the IoT MQ pluggable components to a cluster.
3
+
description: Deploy Dapr and the MQTT broker pluggable components to a cluster.
4
4
author: PatAltimore
5
5
ms.author: patricka
6
6
ms.subservice: azure-mqtt-broker
@@ -20,7 +20,7 @@ MQTT broker supports two of these building blocks, powered by [MQTT broker](../m
20
20
- Publish and subscribe
21
21
- State management
22
22
23
-
To use the IoT MQ Dapr pluggable components, define the component spec for each of the APIs and then [register this to the cluster](https://docs.dapr.io/operations/components/pluggable-components-registration/). The Dapr components listen to a Unix domain socket placed on the shared volume. The Dapr runtime connects with each socket and discovers all services from a given building block API that the component implements.
23
+
To use the MQTT broker Dapr pluggable components, define the component spec for each of the APIs and then [register this to the cluster](https://docs.dapr.io/operations/components/pluggable-components-registration/). The Dapr components listen to a Unix domain socket placed on the shared volume. The Dapr runtime connects with each socket and discovers all services from a given building block API that the component implements.
To register MQ's pluggable pub/sub and state management components, create the component manifest yaml, and apply it to your cluster.
40
+
To register MQTT broker's pluggable pub/sub and state management components, create the component manifest yaml, and apply it to your cluster.
41
41
42
42
To create the yaml file, use the following component definitions:
43
43
@@ -47,7 +47,7 @@ To create the yaml file, use the following component definitions:
47
47
> |`metadata.name`| The component name is important and is how a Dapr application references the component. |
48
48
> | `metadata.annotations` | Component annotations used by the Dapr sidecar injector
49
49
> |`spec.type`|[The type of the component](https://docs.dapr.io/operations/components/pluggable-components-registration/#define-the-component), which must be declared exactly as shown. It tells Dapr what kind of component (`pubsub` or `state`) it is and which Unix socket to use. |
50
-
> |`spec.metadata.url`| The URL tells the component where the local MQ endpoint is. Defaults to `8883` is MQ's default MQTT port with TLS enabled. |
50
+
> |`spec.metadata.url`| The URL tells the component where the local MQTT broker endpoint is. Defaults to `8883` is MQTT broker's default MQTT port with TLS enabled. |
51
51
> |`spec.metadata.satTokenPath`| The Service Account Token is used to authenticate the Dapr components with the MQTT broker |
52
52
> |`spec.metadata.tlsEnabled`| Define if TLS is used by the MQTT broker. Defaults to `true`|
53
53
> |`spec.metadata.caCertPath`| The certificate chain path for validating the broker, required if `tlsEnabled` is `true`|
@@ -140,12 +140,12 @@ To create the yaml file, use the following component definitions:
140
140
component.dapr.io/aio-mq-statestore created
141
141
```
142
142
143
-
## Create authorization policy for IoT MQ
143
+
## Create authorization policy for MQTT broker
144
144
145
145
To configure authorization policies to MQTT broker, first you create a [BrokerAuthorization](../manage-mqtt-broker/howto-configure-authorization.md) resource.
146
146
147
147
> [!NOTE]
148
-
> If Broker Authorization is not enabled on this cluster, you can skip this section as the applications will have access to all MQTT topics, including those needed to access the IoT MQ State Store.
148
+
> If Broker Authorization is not enabled on this cluster, you can skip this section as the applications will have access to all MQTT topics, including those needed to access the MQTT broker State Store.
149
149
150
150
1. Save the following yaml, which contains a BrokerAuthorization definition, to a file named `aio-dapr-authz.yaml`:
0 commit comments