Before using the Java SDK to send and subscribe to messages, follow the steps in this topic to prepare the environment.


  1. Use either of the following methods to add the dependency of the Java SDK:
    • Use Maven:
          // Enter the latest Java SDK version.
    • Download the dependency JAR package: For the download link of the latest version of Java SDK, see Release notes of Java SDK.
  2. Resource information such as the topic and group ID in the code must have been created in the Message Queue for Apache RocketMQ console first.

What to do next

Log configuration.


After preparing the environment, you can send and subscribe to messages as needed.