All Products
Search
Document Center

ApsaraMQ for RocketMQ:Environment preparation

Last Updated:May 31, 2024

Before you use code in the Java language to send and receive messages, perform the steps that are described in this topic to prepare the environment.

Important
  • We recommend that you use the latest RocketMQ 5.x SDKs. These SDKs are fully compatible with ApsaraMQ for RocketMQ 5.x brokers and provide more functions and enhanced features. For more information, see Release notes.

  • Alibaba Cloud only maintains RocketMQ 3.x, 4.x, and TCP client SDKs. We recommend that you use them only for existing business.

Procedure

  1. Use one of the following methods to add the dependency:

    • Introduce the dependency by using Maven:

      <dependency>
          <groupId>com.aliyun.openservices</groupId>
          <artifactId>ons-client</artifactId>
          <!--We recommend that you replace the following version number with the latest version number of the SDK for Java-->
          <version>1.8.8.1.Final</version>
      </dependency>                            
    • Download the dependency JAR package: For information about the download link for the SDK for Java, see Release notes.

  2. Create resources that are referred to in the code of the TCP client SDK for Java in the ApsaraMQ for RocketMQ console. The resources include topics and groups. For more information, see Step 2: Create resources.

What to do next

Logging settings