断路器 微服务_[微服务体系结构]什么是断路器,以及如何使用.NET Core实现断路器?...

断路器 微服务

NOTE: This article is for people that have basic understanding about Microservices Architecture (MSA) and want to deep dive into it. If you are newbie in MSA world, I would like to recommend 2 websites — where you can find everything related to MSA from beginner to advanced level:

注意:本文适用于对微服务体系结构(MSA)有基本了解并希望深入研究它的人们。 如果您是MSA领域的新手,我想推荐2个网站-从初级到高级,您都可以找到与MSA相关的所有信息:

https://martinfowler.com/microservices/

https://martinfowler.com/microservices/

https://microservices.io

https://microservices.io

什么是断路器? (What is Circuit Breaker?)

A circuit breaker is an automatically operated electrical switch designed to protect an electrical circuit from damage caused by excess current from an overload or short circuit. Its basic function is to interrupt current flow after a fault is detected. Unlike a fuse, which operates once and then must be replaced, a circuit breaker can be reset (either manually or automatically) to resume normal operation. — Wikipedia.

背景 技术断路器 是自动操作的 切换 设计用来保护一个 电路 从过载或过剩引起的电流损坏 短路 它的基本功能是在检测到故障后中断电流。 只能操作一次然后必须更换 保险丝 不同 ,可以将断路器复位(手动或自动)以恢复正常操作。 维基百科

But, wait….!

可是等等…。!

This is a Software Programming topic, and why I’m bring something related to Electrical Technology into this topic?

这是一个软件编程主题,为什么我将与电气技术相关的东西带入该主题?

Because the way we apply Circuit Breaker Pattern in Software Programming is very similar. And I just want to bring something that you are familiar with in order to make the topic easier to understand.

因为我们在软件编程中应用断路器模式的方式非常相似。 我只想带一些您熟悉的东西,以使该主题更易于理解。

Back to the definition of Circuit Breaker in Software Programming…

返回软件编程中断路器的定义…

Circuit Breaker pattern is used to detect failures and encapsulates the logic of preventing a failure from constantly recurring, during maintenance, temporary external system failure or unexpected system difficulties. — Wikipedia

断路器模式用于检测故障,并封装了防止故障在维护期间不断重复发生,维护,临时外部系统故障或意外系统故障的逻辑。 维基百科

Bear in mind that, It’s not available to prevent the broken service, but not to make it worse than it was. While other design patterns are born for making our solution easy to maintain, maximize reusability, better performance… then Circuit Breaker is the one for “when sh*t happens”.

请记住,它不能用于防止服务中断,但不能使其比以前更糟。 虽然其他设计模式应运而生,以使我们的解决方案易于维护,最大化可重用性,更好的性能……然后断路器是“

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值