{"id":264591,"date":"2023-03-28T08:19:35","date_gmt":"2023-03-28T00:19:35","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=264591"},"modified":"2023-02-20T20:20:49","modified_gmt":"2023-02-20T12:20:49","slug":"fusing-degradation-difference","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/fusing-degradation-difference.html","title":{"rendered":"\u7194\u65ad\u548c\u964d\u7ea7\u6709\u4ec0\u4e48\u533a\u522b\uff1f"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u7194\u65ad\u548c\u964d\u7ea7\u90fd\u662f\u7cfb\u7edf\u81ea\u6211\u4fdd\u62a4\u7684\u4e00\u79cd\u673a\u5236\uff0c\u4f46\u4e8c\u8005\u53c8\u6709\u6240\u4e0d\u540c\uff0c\u5b83\u4eec\u7684\u533a\u522b\u4e3b\u8981\u4f53\u73b0\u5728\u4ee5\u4e0b\u51e0\u70b9\uff1a\u6982\u5ff5\u4e0d\u540c\uff0c\u89e6\u53d1\u6761\u4ef6\u4e0d\u540c\uff0c\u5f52\u5c5e\u5173\u7cfb\u4e0d\u540c\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
1.\u6982\u5ff5\u4e0d\u540c<\/strong><\/div>\n
1.1 \u7194\u65ad\u6982\u5ff5<\/strong><\/span><\/div>\n

\u201c\u7194\u65ad\u201d\u4e00\u8bcd\u65e9\u671f\u6765\u81ea\u80a1\u7968\u5e02\u573a\u3002\u7194\u65ad\uff08Circuit Breaker\uff09\u4e5f\u53eb\u81ea\u52a8\u505c\u76d8\u673a\u5236\uff0c\u662f\u6307\u5f53\u80a1\u6307\u6ce2\u5e45\u8fbe\u5230\u89c4\u5b9a\u7684\u7194\u65ad\u70b9\u65f6\uff0c\u4ea4\u6613\u6240\u4e3a\u63a7\u5236\u98ce\u9669\u91c7\u53d6\u7684\u6682\u505c\u4ea4\u6613\u63aa\u65bd\u3002\u6bd4\u5982 2020 \u5e74 3 \u6708 9 \u65e5\uff0c\u7ebd\u7ea6\u80a1\u5e02\u5f00\u76d8\u51fa\u73b0\u66b4\u8dcc\uff0c\u968f\u540e\u8dcc\u5e45\u8fbe\u5230 7% \u4e0a\u9650\uff0c\u89e6\u53d1\u7194\u65ad\u673a\u5236\uff0c\u505c\u6b62\u4ea4\u6613 15 \u5206\u949f\uff0c\u6062\u590d\u4ea4\u6613\u540e\u8dcc\u5e45\u6709\u6240\u51cf\u7f13\u3002<\/p>\n

\u800c\u7194\u65ad\u5728\u7a0b\u5e8f\u4e2d\uff0c\u8868\u793a\u201c\u65ad\u5f00\u201d\u7684\u610f\u601d\u3002\u5982\u53d1\u751f\u4e86\u67d0\u4e8b\u4ef6\uff0c\u7a0b\u5e8f\u4e3a\u4e86\u6574\u4f53\u7684\u7a33\u5b9a\u6027\uff0c\u6240\u4ee5\u6682\u65f6\uff08\u65ad\u5f00\uff09\u505c\u6b62\u670d\u52a1\u4e00\u6bb5\u65f6\u95f4\uff0c\u4ee5\u4fdd\u8bc1\u7a0b\u5e8f\u53ef\u7528\u65f6\u518d\u88ab\u4f7f\u7528\u3002<\/p>\n

\u5982\u679c\u6ca1\u6709\u7194\u65ad\u673a\u5236\u7684\u8bdd\uff0c\u4f1a\u5bfc\u81f4\u8054\u673a\u6545\u969c\u548c\u670d\u52a1\u96ea\u5d29\u7b49\u95ee\u9898\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a
\n\"\"<\/p>\n

1.2 \u964d\u7ea7\u6982\u5ff5<\/strong><\/span><\/div>\n

\u964d\u7ea7\uff08Degradation\uff09\u964d\u4f4e\u7ea7\u522b\u7684\u610f\u601d\uff0c\u5b83\u662f\u6307\u7a0b\u5e8f\u5728\u51fa\u73b0\u95ee\u9898\u65f6\uff0c\u4ecd\u80fd\u4fdd\u8bc1\u6709\u9650\u529f\u80fd\u53ef\u7528\u7684\u4e00\u79cd\u673a\u5236\u3002<\/p>\n

\u6bd4\u5982\u7535\u5546\u4ea4\u6613\u7cfb\u7edf\u5728\u53cc 11 \u65f6\uff0c\u4f7f\u7528\u7684\u4eba\u6bd4\u8f83\u591a\uff0c\u6b64\u65f6\u5982\u679c\u5f00\u653e\u6240\u6709\u529f\u80fd\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u7cfb\u7edf\u4e0d\u53ef\u7528\uff0c\u6240\u4ee5\u6b64\u65f6\u53ef\u4ee5\u5f00\u542f\u964d\u7ea7\u529f\u80fd\uff0c\u4f18\u5148\u4fdd\u8bc1\u652f\u4ed8\u529f\u80fd\u53ef\u7528\uff0c\u800c\u5176\u4ed6\u975e\u6838\u5fc3\u529f\u80fd\uff0c\u5982\u8bc4\u8bba\u3001\u7269\u6d41\u3001\u5546\u54c1\u4ecb\u7ecd\u7b49\u529f\u80fd\u53ef\u4ee5\u6682\u65f6\u5173\u95ed\u3002<\/p>\n

\u6240\u4ee5\uff0c\u4ece\u4e0a\u8ff0\u4fe1\u606f\u53ef\u4ee5\u770b\u51fa\uff1a\u964d\u7ea7\u662f\u4e00\u79cd\u9000\u800c\u6c42\u5176\u6b21\u7684\u9009\u62e9\uff0c\u800c\u7194\u65ad\u5374\u662f\u6574\u4f53\u4e0d\u53ef\u7528\u3002<\/p>\n

2.\u89e6\u53d1\u6761\u4ef6\u4e0d\u540c<\/strong><\/div>\n

\u4e0d\u540c\u6846\u67b6\u7684\u7194\u65ad\u548c\u964d\u7ea7\u7684\u89e6\u53d1\u6761\u4ef6\u662f\u4e0d\u540c\u7684\uff0c\u672c\u6587\u54b1\u4eec\u4ee5\u7ecf\u5178\u7684 Spring Cloud \u7ec4\u4ef6 Hystrix \u4e3a\u4f8b\uff0c\u6765\u8bf4\u660e\u89e6\u53d1\u6761\u4ef6\u7684\u95ee\u9898\u3002<\/p>\n

2.1 Hystrix \u7194\u65ad\u89e6\u53d1\u6761\u4ef6<\/strong><\/span><\/div>\n

\u9ed8\u8ba4\u60c5\u51b5 hystrix \u5982\u679c\u68c0\u6d4b\u5230 10 \u79d2\u5185\u8bf7\u6c42\u7684\u5931\u8d25\u7387\u8d85\u8fc7 50%\uff0c\u5c31\u89e6\u53d1\u7194\u65ad\u673a\u5236\u3002\u4e4b\u540e\u6bcf\u9694 5 \u79d2\u91cd\u65b0\u5c1d\u8bd5\u8bf7\u6c42\u5fae\u670d\u52a1\uff0c\u5982\u679c\u5fae\u670d\u52a1\u4e0d\u80fd\u54cd\u5e94\uff0c\u7ee7\u7eed\u8d70\u7194\u65ad\u673a\u5236\u3002\u5982\u679c\u5fae\u670d\u52a1\u53ef\u8fbe\uff0c\u5219\u5173\u95ed\u7194\u65ad\u673a\u5236\uff0c\u6062\u590d\u6b63\u5e38\u8bf7\u6c42\u3002<\/p>\n

\"\"<\/p>\n

2.2 Hystrix \u964d\u7ea7\u89e6\u53d1\u6761\u4ef6<\/strong><\/span><\/div>\n

\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0chystrix \u5728\u4ee5\u4e0b 4 \u79cd\u6761\u4ef6\u4e0b\u90fd\u4f1a\u89e6\u53d1\u964d\u7ea7\u673a\u5236\uff1a<\/p>\n

\u65b9\u6cd5\u629b\u51fa HystrixBadRequestException
\n\u65b9\u6cd5\u8c03\u7528\u8d85\u65f6
\n\u7194\u65ad\u5668\u5f00\u542f\u62e6\u622a\u8c03\u7528
\n\u7ebf\u7a0b\u6c60\u6216\u961f\u5217\u6216\u4fe1\u53f7\u91cf\u5df2\u6ee1
\n\u867d\u7136 hystrix \u7ec4\u4ef6\u7684\u89e6\u53d1\u673a\u5236\uff0c\u4e0d\u80fd\u4ee3\u8868\u6240\u6709\u7684\u7194\u65ad\u548c\u964d\u7ea7\u673a\u5236\uff0c\u4f46\u8db3\u77e3\u8bf4\u660e\u6b64\u95ee\u9898\u3002<\/p>\n

3.\u5f52\u5c5e\u5173\u7cfb\u4e0d\u540c<\/strong><\/div>\n

\u7194\u65ad\u65f6\u53ef\u80fd\u4f1a\u8c03\u7528\u964d\u7ea7\u673a\u5236\uff0c\u800c\u964d\u7ea7\u65f6\u901a\u5e38\u4e0d\u4f1a\u8c03\u7528\u7194\u65ad\u673a\u5236\u3002\u56e0\u4e3a\u7194\u65ad\u662f\u4ece\u5168\u5c40\u51fa\u53d1\uff0c\u4e3a\u4e86\u4fdd\u8bc1\u7cfb\u7edf\u7a33\u5b9a\u6027\u800c\u505c\u7528\u670d\u52a1\uff0c\u800c\u964d\u7ea7\u662f\u9000\u800c\u6c42\u5176\u6b21\uff0c\u63d0\u4f9b\u4e00\u79cd\u4fdd\u5e95\u7684\u89e3\u51b3\u65b9\u6848\uff0c\u6240\u4ee5\u5b83\u4eec\u7684\u5f52\u5c5e\u5173\u7cfb\u662f\u4e0d\u540c\uff08\u7194\u65ad > \u964d\u7ea7\uff09\u3002<\/p>\n

\u9898\u5916\u8bdd<\/strong><\/div>\n

\u5f53\u7136\uff0c\u67d0\u4e9b\u6846\u67b6\u5982 Sentinel\uff0c\u5b83\u65e9\u671f\u5728 Dashboard \u63a7\u5236\u53f0\u4e2d\u53ef\u80fd\u53eb\u201c\u964d\u7ea7\u201d\uff0c\u4f46\u5728\u65b0\u7248\u4e2d\u65b0\u7248\u672c\u53c8\u53eb\u201c\u7194\u65ad\u201d\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n

\"\"<\/p>\n

\u4f46\u5728\u4e24\u4e2a\u7248\u672c\u4e2d\u90fd\u662f\u901a\u8fc7\u540c\u4e00\u4e2a\u5f02\u5e38\u7c7b\u578b DegradeException \u6765\u76d1\u542c\u7684\uff0c\u5982\u4e0b\u4ee3\u7801\u6240\u793a\uff1a
\n\"\"<\/p>\n

\u6240\u4ee5\uff0c\u5728 Sentinel \u4e2d\uff0c\u7194\u65ad\u548c\u964d\u7ea7\u529f\u80fd\u6307\u7684\u90fd\u662f\u540c\u4e00\u4ef6\u4e8b\uff0c\u4e5f\u4fa7\u9762\u8bc1\u660e\u4e86\u201c\u7194\u65ad\u201d\u548c\u201c\u964d\u7ea7\u201d\u6982\u5ff5\u7684\u76f8\u4f3c\u6027\u3002\u4f46\u6211\u4eec\u8981\u77e5\u9053\u5b83\u4eec\u672c\u8d28\u4e0a\u662f\u4e0d\u540c\u7684\uff0c\u5c31\u50cf\u4e24\u4e2a\u53cc\u80de\u80ce\uff0c\u4e0d\u80fd\u56e0\u4e3a\u4ed6\u4eec\u957f\u5f97\u50cf\uff0c\u5c31\u8bf4\u4ed6\u4eec\u662f\u540c\u4e00\u4e2a\u4eba\u3002<\/p>\n

\u603b\u7ed3<\/strong><\/div>\n

\u7194\u65ad\u548c\u964d\u7ea7\u90fd\u662f\u7a0b\u5e8f\u5728\u6211\u4fdd\u62a4\u7684\u4e00\u79cd\u673a\u5236\uff0c\u4f46\u4e8c\u8005\u5728\u6982\u5ff5\u3001\u89e6\u53d1\u6761\u4ef6\u3001\u5f52\u5c5e\u5173\u7cfb\u4e0a\u90fd\u662f\u4e0d\u540c\u7684\u3002\u7194\u65ad\u66f4\u504f\u5411\u4e8e\u5168\u5c40\u89c6\u89d2\u7684\u81ea\u6211\u4fdd\u62a4\uff08\u673a\u5236\uff09\uff0c\u800c\u964d\u7ea7\u5219\u504f\u5411\u4e8e\u5177\u4f53\u6a21\u5757\u201c\u9000\u800c\u8bf7\u5176\u6b21\u201d\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u201c\u7194\u65ad\u201d\u4e00\u8bcd\u65e9\u671f\u6765\u81ea\u80a1\u7968\u5e02\u573a\u3002\u7194\u65ad\uff08Circuit Breaker\uff09\u4e5f\u53eb\u81ea\u52a8\u505c\u76d8\u673a\u5236\uff0c\u662f\u6307\u5f53\u80a1\u6307\u6ce2\u5e45\u8fbe\u5230\u89c4\u5b9a\u7684 […]<\/p>\n","protected":false},"author":1903,"featured_media":264607,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-264591","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/264591","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1903"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=264591"}],"version-history":[{"count":1,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/264591\/revisions"}],"predecessor-version":[{"id":264596,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/264591\/revisions\/264596"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/264607"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=264591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=264591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=264591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}