如何管理微服务故障? [英] How to manage microservice failure?

查看:96
本文介绍了如何管理微服务故障?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

比方说,我有几个微服务(REST API),问题是,如果无法访问一个服务(让我们调用服务"A"),则发送到服务"A"的数据将被临时保存数据库.服务工作后,数据将再次发送. 问题: 1.是否应该每隔10秒创建一次对服务"A"执行ping操作的服务,以了解服务是否有效?还是可以通过任务队列来做到这一点?有什么建议?

Let's say, I have several micro-services (REST API), the problem is, if one service is not accessible (let's call service "A" ) the data which was sending to service "A" will be saved in temporary database. And after service worked, the data will be sent again. Question: 1. Should I create the service which pings to service "A" in every 10 seconds to know service works or not? Or is it possible to do it by task queue? Any suggestions?

推荐答案

服务"A"在可用时会触发就绪"事件.只需听一遍然后重新发送您的请求即可.

Service "A" should fire a "ready" event when it becomes available. Just listen to that and resend your request.

这篇关于如何管理微服务故障?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆