IoTIoT

Compute
Elastic Cloud Server
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
Domain Name Service
VPC Endpoint
Cloud Connect
Enterprise Switch
Security & Compliance
Anti-DDoS
Web Application Firewall
Host Security Service
Data Encryption Workshop
Database Security Service
Advanced Anti-DDoS
Data Security Center
Container Guard Service
Situation Awareness
Managed Threat Detection
Compass
Cloud Certificate Manager
Anti-DDoS Service
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GaussDB NoSQL
GaussDB(for MySQL)
Distributed Database Middleware
GaussDB(for openGauss)
Developer Services
ServiceStage
Distributed Cache Service
Simple Message Notification
Application Performance Management
Application Operations Management
Blockchain
API Gateway
Cloud Performance Test Service
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
DevCloud
ProjectMan
CodeHub
CloudRelease
CloudPipeline
CloudBuild
CloudDeploy
Cloud Communications
Message & SMS
Cloud Ecosystem
Marketplace
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP License Service
Support Plans
Customer Operation Capabilities
Partner Support Plans
Professional Services
enterprise-collaboration
Meeting
IoT
IoT
Intelligent EdgeFabric
DeveloperTools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Updated at: Feb 24, 2022 GMT+08:00

Message Format

An MQTT message consists of fixed header, variable header, and payload.

For details about the format of fixed header and variable header, see MQTT Version V3.1.1. Payload is defined by the application in the PUBLISH (PUB) message, that is, by the device and the IoT platform.

The following describes the CONNECT, SUBSCRIBE, and PUBLISH messages.

  • CONNECT - Client requests a connection to a server

    For details about the parameters in the payload of a CONNECT message, see MQTT Connection Authentication Through CONNECT Messages.

  • SUBSCRIBE - Subscribe to named topics

    Set Topic name in the payload to the topic that a device wants to subscribe to. Currently, the value of this parameter is the topic of the device. For details, see Topic Definition.

  • PUBLISH - Publish message
    • The value of Topic name in the variable header is the topic of the IoT platform when the device sends a message to the IoT platform. When the device receives a message from the IoT platform, the value of Topic name is the topic of the device. For details, see Topic Definition.
    • The content in the payload is a complete data reporting message or command delivery message. Currently, it is a JSON object.

Did you find this page helpful?

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel