Set up Maven dependencies and create cloud resources before you use the TCP client SDK for Java (Community Edition) to send and receive messages with ApsaraMQ for RocketMQ.
Add SDK dependencies
Add the rocketmq-client and rocketmq-acl libraries to your project by using one of the following methods.
Maven (recommended)
Add the following dependencies to your pom.xml file:
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-client</artifactId>
<version>4.5.2</version>
<!-- Update to the latest version -->
</dependency>
<dependency>
<groupId>org.apache.rocketmq</groupId>
<artifactId>rocketmq-acl</artifactId>
<version>4.5.2</version>
<!-- Update to the latest version -->
</dependency>Download JAR files
Download the JAR files from the Apache RocketMQ official website and add them to your project classpath.
Create cloud resources
Create the following resources in the ApsaraMQ for RocketMQ console:
| Resource | Description |
|---|---|
| Instance | The messaging server that hosts your topics and groups |
| Topic | The category to which messages are published |
| Group | The identifier for a set of producers or consumers |
For step-by-step instructions, see Step 2: Create resources.
What's next
After you set up your environment, start sending and receiving messages: