All Products
Search
Document Center

ApsaraMQ for RocketMQ:Environment preparation

Last Updated:Aug 27, 2024

This topic describes how to prepare the environment before you use the SDK for Go to send and receive messages.

Procedure

  1. Download the Go client. For more information, see the SDK source code repository.

  2. Obtain the resources.

    You must create the resources, including the instance endpoint, topic, and consumer group, that are used in the code of the SDK in the ApsaraMQ for RocketMQ console in advance. For more information, see Step 2: Create resources.

  3. Run the following command to install the SDK for Go:

    go get -u github.com/apache/rocketmq-clients/golang/v5
  4. Modify the parameters in the sample code based on the resource information obtained in Step 2: Create resources. Then, run the sample code.