Message Queue for MQTT allows you to send and subscribe to messages by using multiple programming languages. This topic provides links to the sample code on how to send and subscribe to messages by using Message Queue for MQTT alone and in conjunction with Message Queue for Apache RocketMQ.

Usage notes of sample code

The programming languages that are used in the sample code provided for a scenario are not the only supported programming languages in the scenario. The sample code provides guidance and reference on how to send and subscribe to messages. For example, in the seventh scenario listed in this topic, messages are sent from Message Queue for Apache RocketMQ and subscribed to by Message Queue for MQTT. Although only the sample code in Java is provided, Java is not the only supported programming language. You can set the parameters in other programming languages by referring to the sample code in Java. Sample code in other programming languages will be soon added.

For more information about the client SDKs supported by Message Queue for MQTT, see Download the SDK.

List of sample code

Sample code in some programming languages are unavailable and will be soon added. Download the SDK for the corresponding programming language and refer to the sample code in Java for your own test. For more information, see Download the SDK.

Language Download URL
Java mqtt.demo.java
C mqtt.demo.c
Python mqtt.demo.python
.NET mqtt.demo.net
JavaScript mqtt.demo.javascript
iOS mqtt.demo.ios
PHP mqtt.demo.php

Sample code in some programming languages are unavailable and will be soon added. Download the SDK for the corresponding programming language and refer to the sample code in Java for your own test. For more information, see Download the SDK.

Language Download URL
Java mqtt.signature.mode.demo.java
C mqtt.signature.mode.demo.c
Python mqtt.signature.mode.demo.python
.NET mqtt.signature.mode.demo.net
JavaScript mqtt.signature.mode.demo.javascript
iOS mqtt.signature.mode.demo.ios
PHP mqtt.signature.mode.demo.php

Sample code in some programming languages are unavailable and will be soon added. Download the SDK for the corresponding programming language and refer to the sample code in Java for your own test. For more information, see Download the SDK.

Language Download URL
Java mqtt.token.mode.demo.java
PHP mqtt.token.mode.demo.php

Sample code in some programming languages are unavailable and will be soon added. Download the SDK for the corresponding programming language and refer to the sample code in Java for your own test. For more information, see Download the SDK.

Language Download URL
Java mqtt.ssl.demo.java
C mqtt.ssl.demo.c
Python mqtt.ssl.mode.demo.python
.NET mqtt.ssl.mode.demo.net
JavaScript mqtt.ssl.demo.javascript
iOS mqtt.ssl.demo.ios

Sample code in some programming languages are unavailable and will be soon added. Download the SDK for the corresponding programming language and refer to the sample code in Java for your own test. For more information, see Download the SDK.

Language Download URL
JavaScript mqtt.demo.javascript

Sample code in some programming languages are unavailable and will be soon added. Download the SDK for the corresponding programming language and refer to the sample code in Java for your own test. For more information, see Download the SDK.

Language Download URL
Java mqtt.demo.java

Sample code in some programming languages are unavailable and will be soon added. Download the SDK for the corresponding programming language and refer to the sample code in Java for your own test. For more information, see Download the SDK.

Language Download URL
Java mqtt.demo.java

Sample code in some programming languages are unavailable and will be soon added. Download the SDK for the corresponding programming language and refer to the sample code in Java for your own test. For more information, see Download the SDK.

Language Download URL
Java mqtt.ordered.msg.demo.java
PHP mqtt.ordered.msg.demo.php

Note If you use the signature-based authentication mode to send and subscribe to messages and need to verify the signature, see Verify signatures in the console.