Prepare the environment

更新时间:
复制 MD 格式

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.

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>
          <!--Replace the following version number with the latest version number of ApsaraMQ for RocketMQ SDK for Java-->
          <version>1.8.8.1.Final</version>
      </dependency>                            
      Note For information about the versions of ApsaraMQ for RocketMQ SDK for Java, see Release notes.
    • Download the dependency JAR package. For information about how to download the lastest version of ApsaraMQ for RocketMQ SDK for Java, see Release notes.
  2. In the console, create the resources required by your code, such as topics and group IDs.

    You can create resources for two protocols:

What to do next

Configure logs

More information