microservices - Circular dependency of client libraries
问题描述
I am working on 2 micro-services currently, microservice A includes microservice B's SDK to call B's API and access some entity classes. Similarly microservice B also includes microservice A's SDK and accesses microservice A's enitity classes.
Now I am facing one issue when I need to bump up the version of microservice B in microservice A and vice versa.
How should I solve this problem?
解决方案
You've already broken the cardinal rule of microservices by tightly coupling the two services.
The right answer here is going to be to refactor these services such that they properly and completely encapsulate functionality. That could involve combining them (if B is always and completely dependent on A, they may not really be separate services), splitting them out into more services, or just shifting responsibility.
But, the path you're on with tight-coupled microservices leads to a distributed monolith which is unlikely to provide the benefits you're after (specifically including the co-dependent revision concern you mention here).
Here's a good answer to a related question that might offer some more insight.
推荐阅读
- c++ - SpriteBatch 和 SpriteFont (DirectXTK) 抛出错误(预期的 unqualified-id)
- kubernetes - 如何在 Kubernetes 上运行的 Spring Boot 应用程序上为 Kafka Streams 远程交互式查询动态配置 application.server
- html - 如何覆盖通用选择器*?
- firefox - 在 Firefox/Safari 中从子域访问 Cookie 失败
- c# - 解析值时遇到意外字符:[。路径“项目”,第 1 行,位置 43
- r - ggplot 抑制 NA 着色
- mysql - Phpmyadmin 存储引擎错误 176(并且无法修复表)
- xcode - React native 不会在设备上运行,而是通过 xcode 在模拟器上运行
- node.js - nodejs中shell命令的跟踪过程
- database - Prestashop 从 DB 返回内爆数组的最后一个值