Before executing the Java code described in this section, please prepare the environment according to the following instructions.
Dependency can be introduced through either one of the following two methods:
Introduce dependency using Maven:
//version number of the latest Java SDK
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.
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.
Applications using MQ services through TCP need to be deployed on ECS instances in the same region.