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
相关推荐
C+-C资深大佬2 小时前
GitHub Actions 自动化运维实战:从零到一构建高效 CI/CD 流水线
运维·自动化·github
小弥儿12 小时前
GitHub今日热榜 | 2026-07-19
人工智能·学习·github·知识图谱
名字还没想好☜13 小时前
Go 的 time.Ticker 陷阱:定时任务里被忽略的内存泄漏与正确关闭
java·数据库·golang·go·定时器
dong_junshuai14 小时前
每天一个开源项目#43 KTransformers:18.5K星的异构MoE推理引擎
github
OpenTiny社区17 小时前
TinyRobot v0.5.0 新版本强在哪?
前端·vue.js·github
humbinal19 小时前
同时支持 gui & cli 的 parquet 文件查看工具,高性能小清新!
hive·python·rust·spark·开源·github·parquet
华科大胡子19 小时前
GitHub Actions 自动化运维实战:从入门到精通
github
灯澜忆梦19 小时前
Go 语言 _JSON---序列化与反序列化
开发语言·golang·json
布朗克16820 小时前
Go入门到精通-22-同步原语
开发语言·后端·golang·同步原语
怒放de生命20101 天前
【web3基础】go-zero使用etcd实现服务注册与发现(四)
golang·web3·etcd·go-zero