All Products
Document Center

Java SDK preparation

Last Updated: Apr 16, 2019

Before executing the Java code described in this section, please prepare the environment according to the following instructions.

  1. Dependency can be introduced through either one of the following two methods:

    • Introduce dependency using Maven:

      1. <dependency>
      2. <groupId>com.aliyun.openservices</groupId>
      3. <artifactId>ons-client</artifactId>
      4. <version>"XXX"</version>
      5. //version number of the latest Java SDK
      6. </dependency>

      About the version number of the latest Java SDK, see Release notes.

    • Download a dependency JAR package:

      About the download link of the latest Java SDK, see Release notes.

  2. The topic and consumer ID involved in the code need to be created first in the MQ console. For details on how to create topics and consumer ID, see Step 2: Create resources in Quick start guide.

  3. Applications using MQ services through TCP need to be deployed on ECS instances in the same region.