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, producer ID, and consumer ID involved in the code need to be created first in the MQ console.
Applications using MQ services through TCP need to be deployed on ECS instances in the same region.
Message tag can be completely customized by the application. For detailed creation process, see Step 2: Create resources.