- 1
在 http://pulsar.apache.org/docs/en/client-libraries-cpp/ 中下载 dep 包并安装

- 2
在 /etc/profile 中增加下面几个配置
export GOPROXY=https://athens.azurefd.net
export GO111MODULE=on
保存后, 执行 source /etc/profile
- 3
go get -u github.com/apache/pulsar/pulsar-client-go/pulsar@6ae9b402ae9cbda249ba3b0cf46737ddf12db277
2019.10.15 更新,如果是下载 2.4.1 版本,就用执行下面这行
go get -u github.com/apache/pulsar/pulsar-client-go/pulsar@afae3a7864d636eb0c0fea72540d2be42c97fd60
- 4
编写一个 pulsar demo 代码,然后在代码目录下执行
go mod init
go build
编译通过
参考文章
本文详细介绍了如何在Go环境中设置和使用Apache Pulsar客户端。步骤包括下载依赖包、配置环境变量、使用特定版本的Go模块进行安装,以及创建和编译示例代码。适合初学者和开发者快速上手。
498

被折叠的 条评论
为什么被折叠?



