This topic describes how to use the TCP client SDK for Java of the Community Edition to access ApsaraMQ for RocketMQ to send and receive messages.
Usage notes
SDKs of the Community Edition are used only in scenarios in which you want to migrate business in Apache RocketMQ clusters to ApsaraMQ for RocketMQ instances without code modification. For other scenarios, we recommend that you use SDKs of the Commercial Edition to connect to ApsaraMQ for RocketMQ. Compared with SDKs of the Community Edition, SDKs of the Commercial Edition provide more features and higher stability. For more information, see Release notes.
Versions
If you want to use the TCP client SDK for Java of the Community Edition to access ApsaraMQ for RocketMQ, you must download the SDK version 4.5.2 or later. We recommend that you use the latest version of the SDK. Download link: TCP client SDK for Java of the Community Edition.
Preparations
Perform the following operations in sequence:
Import Maven dependencies.
Create the required resources in the ApsaraMQ for RocketMQ console.
For more information, see Preparations.
(Optional) Parameters
Before you use the TCP client SDK for Java of the Community Edition to connect to ApsaraMQ for RocketMQ to send and receive messages, you must configure the required parameters. For more information, see Parameters.
You can also see the comments in the TCP client SDK for Java of the Community Edition to obtain the details of the parameters.