golang 调用 github.com/Shopify/sarama 库坑记录

问题描述

  • 当 golang 使用 github.com/Shopify/sarama 调用 kafka 时会遇到下面两个问题
  • go mod tidy 事后会遇到路径错误
  • 编译后连接 kafka 也会有错误信息

go mod tidy 错误信息

复制代码
go: github.com/IBM/sarama@v1.43.3 used for two different module paths (github.com/IBM/sarama and github.com/Shopify/sarama)

新版本 sarama 启动会遇到下面错误

复制代码
[2024-12-03 16:33:11.447] [INFO] [37888] [commands.go:33] >>> [falcon-kafka_consumer] msg=proc.Start, ok
[2024-12-03 16:33:11.448] [INFO] [37888] [commands.go:33] >>> [falcon-kafka_consumer] msg=send.Start, ok
[2024-12-03 16:33:11.448] [INFO] [37888] [commands.go:33] >>> [falcon-kafka_consumer] msg=start to init consumer group of low version kafka
[2024-12-03 16:33:11.448] [INFO] [37888] [commands.go:33] >>> [falcon-kafka_consumer] msg=http.startHttpServer ok, listening: 0.0.0.0:6850
[2024-12-03 16:33:12.241] [ERROR] [37888] [commands.go:33] >>> [falcon-kafka_consumer] msg=init high consumer group error: kafka: client has run out of available brokers to talk to: 6 errors occurred:
	* EOF
	* EOF
	* EOF
	* EOF
相关推荐
codeejun31 分钟前
每日一Go·MySQL-24、死锁排查与解决方案
开发语言·mysql·golang
逛逛GitHub5 小时前
推荐 11 个本月热门的 GitHub 开源项目,尤其是第 9 个。
github
利威尔xu6 小时前
Go context取消传播3层:信号传不到第3层goroutine,泄漏拖垮
后端·golang
Sakura_j_h_9 小时前
TypeScript 7.0 换 Go 编译器后,我先在 6.0 清完默认值
javascript·golang·typescript·vite·前端工程化·tsc
钱栈up13 小时前
GitHub 热榜上手|T3 Code:手机远程操控 7 款 AI 编程 Agent
typescript·开源·github
`流年づ19 小时前
联邦学习-安全聚合
git·安全·github
CoderYanger21 小时前
Java EE 进阶:14.案例综合练习-博客系统(第二弹):博客详情+令牌技术
服务器·前端·spring boot·后端·spring·java-ee·github
逛逛GitHub1 天前
民间大神移植《GTA 6》进度已经到 90% 了,这几个 GitHub 项目关注一下
github
码途行者1 天前
每天10分钟学Go:第23课 协程(goroutine)
开发语言·后端·golang