当前位置: 首页> 健康> 母婴 > 已备案域名租用_网站架构图图_nba最新消息新闻_各大搜索引擎入口

已备案域名租用_网站架构图图_nba最新消息新闻_各大搜索引擎入口

时间:2025/7/20 18:19:54来源:https://blog.csdn.net/signmem/article/details/144232814 浏览次数:0次
已备案域名租用_网站架构图图_nba最新消息新闻_各大搜索引擎入口

问题描述

  • 当 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)
  • 因为 IBM 收购了项目, 因此项目代码已经完全迁移至 IBM 组织中
  • 解决方法 修改 go.mod 文件, 通过 replace 指定一个版本
replace github.com/Shopify/sarama => github.com/IBM/sarama v1.43.3

新版本 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
  • 参考官网, 降版本后可解决问题
  • 修改 go.mod 文件如下
replace github.com/Shopify/sarama => github.com/IBM/sarama v0.0.0-20180712172306-5cd4d8675b3b
replace github.com/IBM/sarama => github.com/Shopify/sarama v0.0.0-20180712172306-5cd4d8675b3b
关键字:已备案域名租用_网站架构图图_nba最新消息新闻_各大搜索引擎入口

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: