Skip to content

Commit 312b68b

Browse files
committed
Fix issues
1 parent e1475e3 commit 312b68b

12 files changed

+51
-87
lines changed

articles/azure-web-pubsub/howto-connect-mqtt-websocket-client.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
title: How to Connect MQTT Clients to Web PubSub
3-
description: How to Connect MQTT Clients to Web PubSub
2+
title: How to Connect MQTT Clients to Azure Web PubSub
3+
description: How to Connect MQTT Clients to Azure Web PubSub
44
author: Y-Sindo
55
ms.author: zityang
66
ms.service: azure-web-pubsub
77
ms.date: 06/17/2024
88
ms.topic: how-to
99
---
1010

11-
# How To Connect MQTT Clients to Web PubSub
11+
# How To connect MQTT clients to Azure Web PubSub
1212

1313
MQTT is a lightweight pub/sub messaging protocol designed for devices with constrained resources.
1414

1515
In this article, we introduce how to connect MQTT clients to the service, so that the clients can publish and subscribe messages.
1616

17-
## Connection Parameters
17+
## Connection parameters
1818

1919
WebSocket connection URI: `wss://{serviceName}.webpubsub.azure.com/clients/mqtt/hubs/{hub}?access_token={token}`.
2020

@@ -55,7 +55,7 @@ These workflows can be used individually or in combination. If they're used in t
5555

5656
This is the default workflow, shown as follows:
5757

58-
![MQTT Auth Workflow With JWT](./media/howto-develop-mqtt-websocket-clients/mqtt-jwt-auth-workflow.png)
58+
![Diagram of MQTT Auth Workflow With JWT.](./media/howto-connect-mqtt-websocket-client/mqtt-jwt-auth-workflow.png)
5959

6060
1. The client negotiates with your auth server. The auth server contains the authorization middleware, which handles the client request and signs a JWT for the client to connect to the service.
6161
1. The auth server returns the JWT to the client.
@@ -135,7 +135,7 @@ You could also add custom claims into the access token, and these values are pre
135135

136136
The MQTT client sends an MQTT CONNECT packet after it establishes a WebSocket connection with the service, then the service calls an API in the upstream server. The upstream server can auth the client according to the username and password fields in the MQTT connection request, and the TLS certificate from the client.
137137

138-
![MQTT Auth Workflow With Upstream Server](./media/howto-develop-mqtt-websocket-clients/mqtt-upstream-auth-workflow.png)
138+
![Diagram of MQTT Auth Workflow With Upstream Server](./media/howto-connect-mqtt-websocket-client/mqtt-upstream-auth-workflow.png)
139139

140140
This workflow needs explicit configuration.
141141
* [Tutorial - Authenticate and authorize MQTT clients based on client certificates](./tutorial-upstream-auth-mqtt-client.md)

articles/azure-web-pubsub/includes/mqtt-components.md

Lines changed: 0 additions & 34 deletions
This file was deleted.
40 KB
Loading

articles/azure-web-pubsub/overview-mqtt.md

Lines changed: 25 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,31 @@ ms.date: 07/15/2024
88
ms.service: azure-web-pubsub
99
ms.topic: overview
1010
---
11-
# Overview: MQTT in Azure Web PubSub Service
12-
13-
## Introduction
11+
# Overview: MQTT in Azure Web PubSub service
1412

1513
[MQTT](https://mqtt.org/) is a lightweight pub/sub messaging protocol designed for devices with constrained resources. Azure Web PubSub service now natively supports MQTT over WebSocket transport.
1614

1715
You can use MQTT protocols in Web PubSub service for the following scenarios:
1816

19-
1. Pub/Sub among MQTT clients and Web PubSub native clients.
20-
1. Broadcast messages to MQTT clients.
21-
1. Get notifications for MQTT client lifetime events.
17+
* Pub/Sub among MQTT clients and Web PubSub native clients.
18+
* Broadcast messages to MQTT clients.
19+
* Get notifications for MQTT client lifetime events.
2220

2321
## Key Features
2422

25-
**Standard MQTT Protocols Support**:
23+
### Standard MQTT Protocols Support
2624

2725
Web PubSub service supports MQTT 3.1.1 and 5.0 protocols in a standard way that any MQTT SDK with WebSocket transport support can connect to Web PubSub. Users who wish to use Web PubSub in a programming language that doesn't have a native Web PubSub SDK can still connect and communicate using MQTT.
2826

29-
**Cross-Protocol Communication**:
27+
### Cross-Protocol Communication
3028

3129
MQTT clients can communicate with clients of other Web PubSub protocols. Find more details [here](./reference-mqtt-cross-protocol-communication.md)
3230

33-
**Easy MQTT adoption for Current Web PubSub Users**:
31+
### Easy MQTT adoption for Current Web PubSub Users
3432

3533
Current users of Azure Web PubSub can use MQTT protocol with minimal modifications to their existing upstream servers. The Web PubSub REST API is already equipped to handle MQTT connections, simplifying the transition process.
3634

37-
**Client-to-Server Request/Response Model**:
35+
### Client-to-Server Request/Response Model
3836

3937
In addition to the client-to-client pub/sub model provided by the MQTT protocols, Web PubSub also support a client-to-server request/response model. Basically Web PubSub converts a specific kind of MQTT application messages into HTTP requests to registered webhooks, and sends the HTTP responses as application messages back to the MQTT clients.
4038

@@ -43,24 +41,24 @@ For more details, see [MQTT custom event handler protocol](./reference-mqtt-clou
4341
## MQTT Feature Support Status
4442
Web PubSub support MQTT protocol version 3.1.1 and 5.0. The supported features include but not limited to:
4543

46-
1. All the levels of Quality Of Service including at most once, at least once and exactly once.
47-
1. Persistent session. MQTT sessions are preserved for up to 30 seconds when client connections are interrupted.
48-
1. Last Will & Testament
49-
1. Client Certificate Authentication
44+
* All the levels of Quality Of Service including at most once, at least once and exactly once.
45+
* Persistent session. MQTT sessions are preserved for up to 30 seconds when client connections are interrupted.
46+
* Last Will & Testament
47+
* Client Certificate Authentication
5048

5149
### Additional Features Supported For MQTT 5.0
5250

53-
1. Message Expiry Interval and Session Expiry Interval
54-
2. Subscription Identifier.
55-
3. Assigned Client ID.
56-
4. Flow Control
57-
5. Server-Sent Disconnect
51+
* Message Expiry Interval and Session Expiry Interval
52+
* Subscription Identifier.
53+
* Assigned Client ID.
54+
* Flow Control
55+
* Server-Sent Disconnect
5856

5957
### Not Supported Feature
60-
1. Wildcard subscription
61-
1. Retained messages
62-
1. Topic alias
63-
1. Shared subscription
58+
* Wildcard subscription
59+
* Retained messages
60+
* Topic alias
61+
* Shared subscription
6462

6563
## How MQTT Is Adapted Into Web PubSub's System
6664

@@ -76,12 +74,12 @@ In general, a server to authenticate and authorize MQTT clients is required. The
7674

7775
* Workflow 1: The MQTT client gets a [JWT(JSON Web Token)](https://jwt.io) from somewhere with its credential, usually from an auth server. Then the client includes the token in the WebSocket upgrading request to the Web PubSub service, and the Web PubSub service validates the token and auth the client. This workflow is enabled by default.
7876

79-
![MQTT Auth Workflow With JWT](./media/howto-develop-mqtt-websocket-clients/mqtt-jwt-auth-workflow.png)
77+
![Diagram of MQTT Auth Workflow With JWT.](./media/howto-develop-mqtt-websocket-clients/mqtt-jwt-auth-workflow.png)
8078

8179
* Workflow 2: The MQTT client sends an MQTT CONNECT packet after it establishes a WebSocket connection with the service, then the service calls an API in the upstream server. The upstream server can auth the client according to the username and password fields in the MQTT connection request, and the TLS certificate from the client. This workflow needs explicit configuration.
8280
<!--Add link to tutorial and configuration-->
8381

84-
![MQTT Auth Workflow With Upstream Server](./media/howto-develop-mqtt-websocket-clients/mqtt-upstream-auth-workflow.png)
82+
![Diagram of MQTT Auth Workflow With Upstream Server.](./media/howto-develop-mqtt-websocket-clients/mqtt-upstream-auth-workflow.png)
8583

8684
These two workflows can be used individually or in combination. If they're used in together, the auth result in the latter workflow would be honored by the service.
8785

@@ -97,8 +95,8 @@ You can register event handlers to get notification when a Web PubSub client con
9795
## REST API Support
9896

9997
You can use REST API to do the following things:
100-
1. Publish messages to a topic, a connection, a Web PubSub user, or all the connections.
101-
1. Manage client permissions and subscriptions.
98+
* Publish messages to a topic, a connection, a Web PubSub user, or all the connections.
99+
* Manage client permissions and subscriptions.
102100

103101
[REST API specification for MQTT](./reference-rest-api-mqtt.md)
104102

articles/azure-web-pubsub/quickstarts-pubsub-among-mqtt-clients.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ This quickstart guide demonstrates how to
2525

2626
> [!NOTE]
2727
> Except for the MQTT client libraries mentioned belows, you can choose any standard MQTT client libraries that meet the following requirements to connect to Web PubSub:
28-
> 1. Support WebSocket transport.
29-
> 2. Support MQTT protocol 3.1.1 or 5.0.
28+
> * Support WebSocket transport.
29+
> * Support MQTT protocol 3.1.1 or 5.0.
3030
3131
# [JavaScript](#tab/javascript)
3232

@@ -72,7 +72,7 @@ For this quick start, you can copy and paste one from Azure portal shown in the
7272

7373
As shown in the preceding code, the client has the permissions to send messages to topic `group1` and to subscribe to topic `group2`.
7474

75-
[!INCLUDE [MQTT-Connection-Parameters](includes/mqtt-connection-Parameters.md)]
75+
[!INCLUDE [MQTT-Connection-Parameters](includes/mqtt-connection-parameters.md)]
7676

7777
The following code shows how to connect MQTT clients to WebPubSub with MQTT protocol version 5.0, clean start, 30-seconds session expiry interval.
7878

@@ -144,10 +144,10 @@ client.connect(host, port, clean_start = True, properties=connect_properties)
144144

145145
### Troubleshooting
146146

147-
If your client failed to connect, you could use the live trace tool for troubleshooting. See [instructions](./howto-troubleshoot-resource-logs.md#launch-the-live-trace-tool) to launch the tool.
147+
If your client failed to connect, you could use the Azure Monitor for troubleshooting. See [Monitor Azure Web PubSub](./howto-azure-monitor.md) for more details.
148148

149-
You can check the connection parameters and get more detailed error messages there. For example, the following screenshot shows that the connection was rejected because it set an invalid keep alive interval.
150-
![the diagram shows a screenshot of Web PubSub live trace app for a successful MQTT connection](./media/quickstarts-pubsub-among-mqtt-clients/live-trace.png)
149+
You can check the connection parameters and get more detailed error messages from the Azure Monitor. For example, the following screenshot of Azure Log Analytics shows that the connection was rejected because it set an invalid keep alive interval.
150+
![Screenshot of Azure Log Analytics.](./media/quickstarts-pubsub-among-mqtt-clients/diagnostic-log.png)
151151

152152
## Subscribe to a topic
153153

articles/azure-web-pubsub/reference-mqtt-cloud-events.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.topic: reference
88
ms.date: 07/16/2024
99
---
1010

11-
# CloudEvents Extension for Azure Web PubSub MQTT Event Handler with HTTP Protocol
11+
# CloudEvents extension for Azure Web PubSub MQTT event handler with HTTP protocol
1212

1313
The Web PubSub service delivers client events to the upstream webhook using the [CloudEvents HTTP protocol binding](https://github.com/cloudevents/spec/blob/v1.0.1/http-protocol-binding.md).
1414

@@ -320,9 +320,9 @@ The service converts specific messages published by MQTT clients to HTTP request
320320

321321
#### Trigger Conditions
322322

323-
1. An MQTT client publishes a message to a topic in the format `$webpubsub/server/events/{eventName}`. `{eventName}` cannot contain the `/` character.
324-
2. The MQTT client has permission to publish to that topic.
325-
3. If the client's protocol is MQTT 5.0, and the PUBLISH packet contains a content type field, the content type value should be a valid MIME type because it will be converted to the `Content-Type` header of an HTTP request.
323+
* An MQTT client publishes a message to a topic in the format `$webpubsub/server/events/{eventName}`. `{eventName}` cannot contain the `/` character.
324+
* The MQTT client has permission to publish to that topic.
325+
* If the client's protocol is MQTT 5.0, and the PUBLISH packet contains a content type field, the content type value should be a valid MIME type because it will be converted to the `Content-Type` header of an HTTP request.
326326

327327
#### Request Format
328328

@@ -382,7 +382,7 @@ mqtt-{request-property-1}: {request-property-value1}
382382
383383
```
384384

385-
#### Response format:
385+
#### Response format
386386

387387
The following table shows the usage of different fields in the HTTP response.
388388

articles/azure-web-pubsub/reference-mqtt-cross-protocol-communication.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Cross-protocol communication between MQTT clients and Web PubSub clients
2+
title: Cross-protocol communication between MQTT clients and Azure Web PubSub clients
33
description: Describes the behavior of cross-protocol communication between MQTT clients and Web PubSub clients
44
keywords: MQTT, MQTT on Azure Web PubSub, MQTT over WebSocket
55
author: Y-Sindo

articles/azure-web-pubsub/reference-rest-api-mqtt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ms.topic: reference
88
ms.date: 07/23/2024
99
---
1010

11-
# REST API Specification for MQTT
11+
# REST API specification for MQTT
1212

1313
This document clarifies the meanings of the Web PubSub data-plane REST API in the context of MQTT. The existing Web PubSub REST API documentation is focused on Web PubSub’s own protocols, which may make its application to MQTT unclear.
1414

0 commit comments

Comments
 (0)