Go 模块文件版本问题缺少最新更改

发布于 2025-01-13 05:27:36 字数 449 浏览 3 评论 0原文

我遇到过这样的情况:我使用 3 个工件以不同的方式构建和部署。

  • 工件 1 有我的最新更改,
  • 工件 2 和 3 将工件 1 下载为模块。

其中:

  • 工件 2 必须对工件 3 进行 GRPC 调用才能访问数据,
  • 与工件 2 相比,工件 3 的工件 1 版本较旧。

现在:

  • 工件 2 在对工件 3 进行 GRPC 调用之前针对工件 1 进行验证,
  • 工件 3在完成交易之前,也会针对工件 1 进行类似的验证。

问题:由于版本较旧,工件 2 中的验证已通过,但工件 3 中的验证失败。
当前代码抛出异常,尝试最多次数。次。

我可以考虑保持工件同步,但是我无法确定它会保持不变。

如何处理这些不兼容性,以免所有请求都失败或产生意外/不一致的结果?

I have a situation where i work with 3 artifacts build and deployed differently.

  • Artifact 1 has my latest changes,
  • Artifact 2 and 3 download artifact 1 as a module.

With:

  • Artifact 2 has to make a GRPC call to Artifact 3 to access data,
  • Artifact 3 has an older version of artifact 1 compared to artifact 2.

Now:

  • Artifact 2 validates against artifact 1 before making the GRPC call to artifact 3,
  • artifact 3 also makes similar validation against artifact 1 before it completes the transaction.

Problem: Validation in artifact 2 passed but fails in artifact 3, because of older version.
Current code throw exception which is tried max no. of times.

I can think of keeping the artifacts in sync however there is no way i can be sure it is going to stay same.

What are the ways these kind of incompatibilities are dealt with so not all requests fail or produce unexpected/inconsistent results?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

风月客 2025-01-20 05:27:36

您可以:

  • 一起开发并发布所有三个工件
  • ,或者发布一个大工件,能够在运行时配置为服务器(旧工件 1)、发送者(旧工件 2)或客户端(旧工件 3)

在这两种选择中,这都是一个发行版您始终无法控制的问题:如何确保正确的版本部署在正确的位置?

这意味着实际的解决方案是确保向后兼容性,允许服务器返回旧版本的GRPC 消息。

You would either:

  • develop and release all three artifact together
  • or release one big artifact, able to be configured at runtime as a server (old Artifact1), sender (old Artifact2) or client (old Artifact3)

In both option, this is a distribution issue that you cannot always control: how to ensure the right version is deployed in the right place?

That means the actual solution is to ensure backward compatibility, allowing the server to return older versions of your GRPC message.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文