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
相关推荐
你不是我我3 小时前
【Java 开发日记】我们来说一说 Redis 主从复制的原理及作用
java·redis·github
-拟墨画扇-5 小时前
Git | 分支管理操作
git·gitee·github·gitcode
molaifeng6 小时前
像搭积木一样理解 Golang AST
开发语言·后端·golang
捧 花9 小时前
前端如何调用后端接口(HTML + JS & Vue )
服务器·golang·vue·api·前后端交互
bybitq10 小时前
Go 语言之旅方法(Methods)与接口(Interfaces)完全指南
开发语言·golang·xcode
saber_andlibert11 小时前
【C++转GO】初阶知识
开发语言·c++·golang
IT艺术家-rookie11 小时前
golang--解决 Go 并发场景下的数据竞争问题的方案
golang
无限进步_12 小时前
C++ Vector 全解析:从使用到深入理解
开发语言·c++·ide·windows·git·github·visual studio
顾安r12 小时前
12.27 脚本网页 GITHUB推送教程
linux·css·html·gitlab·github
A132470531213 小时前
curl命令入门:命令行测试接口
linux·运维·服务器·网络·编辑器·github·vim