在微服务中,可能一个站点会有很多的RPC依赖,那么如何保证其稳定性和数据一致性呢?

我一个操作中可能会同时调用多个依赖,在调用时比如某个服务调用失败了,那么是保证所有外部服务调用成功,这个操作才算成功,还是直接跳过这个操作

目前考虑了用类似于消息队列的模式来进行预防,调用失败时,将数据存入数据裤,然后通过轮询进行再次执行。


ITMISS
浏览 1518回答 1
1回答

大话西游666

参考:Challenge #3: How to achieve consistency across multiple microservicesA good solution for this problem is to use eventual consistency between microservices articulated through event-driven communication and a publish-and-subscribe system.Implementing event-based communication between microservices (integration events)You can use events to implement business transactions that span multiple services, which gives you eventual consistency between those services. An eventually consistent transaction consists of a series of distributed actions. At each action, the microservice updates a business entity and publishes an event that triggers the next action.
打开App,查看更多内容
随时随地看视频慕课网APP