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
相关推荐
开发小程序的之朴8 小时前
认识安企CMS-安装安企CMS的环境要求
nginx·golang·系统架构
北冥you鱼10 小时前
abigen 最佳实践:从入门到精通,高效生成 Go 语言合约绑定
开发语言·golang·区块链
北冥you鱼13 小时前
Go 语言读取链上数据:从基础到实战
开发语言·后端·golang
DogDaoDao13 小时前
ShellGPT:当大语言模型遇见命令行——深度解析一个 CLI AI 生产力工具的设计与实现
人工智能·语言模型·自然语言处理·github·大语言模型·shellgpt·终端命令行
uhakadotcom15 小时前
Python 中,`None` 不等于 `False`导致的问题
后端·面试·github
小弥儿17 小时前
GitHub今日热榜 | 2026-07-05:阿里巴巴浏览器Agent上榜
学习·开源·github
uhakadotcom19 小时前
什么是 “无界限的列表积累” 问题
后端·面试·github
ttwuai19 小时前
GoFrame + Vue3 后台管理系统实战:CRUD、权限和菜单如何少写重复代码
golang
大P哥阿豪20 小时前
Go panic & recover:深入Go语言的异常拯救之道
开发语言·后端·golang·go
雨师@1 天前
go语言项目--实例化(图书管理)--004
开发语言·后端·golang