Connect using the community edition SDK for Java

更新时间:
复制 MD 格式

Use the community edition SDK for Java over TCP to connect to ApsaraMQ for RocketMQ and send and receive messages.

Usage notes

Use the community edition SDK only if you migrate open source RocketMQ to the cloud and do not want to modify your code. For all other scenarios, use the commercial edition SDK provided by ApsaraMQ for RocketMQ. The commercial edition SDK provides more features and greater stability than the community edition SDK. For more information, see SDK for Java (Commercial Edition).

Version guide

The community edition SDK for Java over TCP requires version 4.5.2 or later. We recommend that you use the latest version. Download the SDK from Community edition TCP SDK for Java.

Preparations

Complete the following steps in order:

  1. Import Maven dependencies.

  2. Create resources in the ApsaraMQ for RocketMQ console.

For more information, see Preparations.

(Optional) Parameter description

Configure the required parameters before you use the community edition SDK for Java over TCP to send and receive messages. For more information, see Parameter description.

Parameter descriptions are also available in the SDK source code comments.

Use the Community Edition Java SDK for the TCP protocol to send and receive messages