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
相关推荐
Hello.Reader2 小时前
用 Kafka 打通实时数据总线Flink CDC Pipeline 的 Kafka Sink 实战
flink·kafka·linq
禁默2 小时前
基于Rust实现爬取 GitHub Trending 热门仓库
开发语言·rust·github
Lab4AI大模型实验室3 小时前
【Github热门项目】DeepSeek-OCR项目上线即突破7k+星!突破10倍无损压缩,重新定义文本-视觉信息处理
人工智能·github·deepseek-ocr
ruanCat3 小时前
对 changelogen 和 changelogithub 使用的思考
前端·github
q***18844 小时前
搭建Golang gRPC环境:protoc、protoc-gen-go 和 protoc-gen-go-grpc 工具安装教程
开发语言·后端·golang
q***65696 小时前
Spring Boot集成Kafka:最佳实践与详细指南
spring boot·kafka·linq
散峰而望14 小时前
C/C++输入输出初级(一) (算法竞赛)
c语言·开发语言·c++·算法·github
码上淘金15 小时前
在 YAML 中如何将 JSON 对象作为字符串整体赋值?——兼谈 Go Template 中的 fromJson 使用
java·golang·json
C.咖.16 小时前
Linux环境下——Git 与 GitHub
linux·git·github·远程仓库
CoderJia程序员甲18 小时前
GitHub 热榜项目 - 日榜(2025-11-12)
ai·开源·大模型·github·ai教程