Before you use the SDK for Java to send and subscribe to messages, perform the steps in this topic to prepare the environment.


  1. Use either of the following methods to add the dependency:
    • Add the dependency by using Maven:
          // Enter the latest version of the SDK for Java.
    • Download the dependency JAR package: For the download link to the latest version, see the Release notes for the SDK for Java.
  2. In the Message Queue for Apache RocketMQ console, create the resources, such as topics and group IDs, that you reference in the code.
    You can create resources based on the following two protocols:

What to do next

Log configuration

More information