Message Queue 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:
  1. Activate Message Queue for MQTT and authorize a RAM user to access Message Queue for MQTT resources

    Activate Message Queue for MQTT and authorize a RAM user to use Message Queue for MQTT resources.

  2. Create resources

    Create instances, topics, and group IDs in the Message Queue for MQTT console.

  3. Use Message Queue for MQTT SDK for Java to send and receive messages.