MQ for MQTT supports message sending and receiving in multiple languages. This topic provides links to sample code of using MQ for MQTT separately and with MQ in combination to send and receive messages in different languages.

Use MQ for MQTT separately to send and receive messages

Language Sample code
Java https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-java-demo/src/main/java/com/aliyun/openservices/lmq/example/demo/MQ4IoTSendMessageToMQ4IoTUseSignatureMode.java
C https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-c-demo/src/c/mqttDemo.c
Python https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-python-demo/MQTTSendMessage2MQTT.py
. NET https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-DoNet-demo/MQTTDemo.cs
JavaScript https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-js-demo/lmqdemo.html
iOS https://github.com/AliwareMQ/lmq-demo/tree/master/lmq-ios-demo/MQTTChatDemo
PHP https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-php-demo/MQTTSendMessageToMQTT.php

Use MQ for MQTT to send messages and MQ to receive messages

Language Sample code
Java https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-java-demo/src/main/java/com/aliyun/openservices/lmq/example/demo/MQ4IoTSendMessageToRocketMQ.java

Use MQ to send messages and MQ for MQTT to receive messages

Language Sample code
Java https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-java-demo/src/main/java/com/aliyun/openservices/lmq/example/demo/RocketMQSendMessageToMQ4IoT.java

Use signatures for authentication on MQTT clients

Language Sample code
Java https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-java-demo/src/main/java/com/aliyun/openservices/lmq/example/demo/MQ4IoTSendMessageToMQ4IoTUseSignatureMode.java
C https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-c-demo/src/c/mqttDemo.c
Python https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-python-demo/MQTTSendMessage2MQTT.py
. NET https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-DoNet-demo/MQTTDemo.cs
JavaScript https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-js-demo/lmqdemo.html
iOS https://github.com/AliwareMQ/lmq-demo/tree/master/lmq-ios-demo/MQTTChatDemo
PHP https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-php-demo/MQTTConnectUseSignatureMode.php

Use token for authentication on MQTT clients

Language Sample code
Java https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-java-demo/src/main/java/com/aliyun/openservices/lmq/example/demo/MQ4IoTSendMessageToMQ4IoTUseTokenMode.java
PHP https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-php-demo/MQTTConnectUseTokenMode.php

Use SSL encryption on MQTT clients

Language Sample code
Java https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-java-demo/src/main/java/com/aliyun/openservices/lmq/example/demo/MQ4IoTSendMessageToMQ4IoTUseSignatureMode.java
C https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-c-demo/src/c/mqttDemo.c
Python https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-python-demo/MQTTSendMessage2MQTT.py
. NET https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-DoNet-demo/MQTTDemo.cs
JavaScript https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-js-demo/lmqdemo.html
iOS https://github.com/AliwareMQ/lmq-demo/tree/master/lmq-ios-demo/MQTTChatDemo

Use MQTT clients to send ordered messages to MQ brokers

Language Sample code
Java https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-java-demo/src/main/java/com/aliyun/openservices/lmq/example/demo/MQ4IoTSendMessageToMQ4IoTUseSignatureMode.java
PHP https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-php-demo/MQTTSendOrderMessage.php

Query the number of online MQTT clients

Language Sample code
Java https://github.com/AliwareMQ/lmq-demo/blob/master/lmq-java-demo/src/main/java/com/aliyun/openservices/lmq/example/demo/QueryOnlineClientNumDemo.java