All Products
Search
Document Center

ApsaraMQ for RocketMQ:Prepare the environment for SDK for Go

Last Updated:Mar 11, 2026

Install Go and the ApsaraMQ for RocketMQ SDK for Go to start sending and subscribing to messages.

Environment requirements

To check your installed version, run:

go version

Install SDK for Go

  1. Run the following command to enable Go mod:

    go env -w GO111MODULE=on
  2. Run the following command to configure a Go mod proxy:

    go env -w GOPROXY=https://goproxy.cn,direct
  3. Initialize Go mod and generate the go.mod file:

    go mod init
  4. Install the SDK package:

    go get github.com/aliyunmq/mq-http-go-sdk