ApsaraMQ for MQTT allows you to use SDKs for different programming languages to connect to the Message Queue for MQTT broker to send and receive messages. This topic describes how to use Message Queue for MQTT SDK for Java to send and receive messages in different scenarios.
Procedure
The following figure shows the process of using Message Queue for MQTT SDK for Java to send and receive messages.
The process includes the following steps:
- Activate ApsaraMQ forMQTT and authorize a RAM user to access ApsaraMQ forMQTT resources
Activate Message Queue for MQTT and authorize a RAM user to use ApsaraMQ for MQTT resources.
- Create resources
Create instances, topics, and group IDs in the ApsaraMQ for MQTT console.
- Use Message Queue for MQTT SDK for Java to send and receive messages.