{"id":359,"date":"2022-04-20T09:54:16","date_gmt":"2022-04-20T01:54:16","guid":{"rendered":"https:\/\/blog.lijiajia.top\/?p=359"},"modified":"2026-06-19T21:33:09","modified_gmt":"2026-06-19T13:33:09","slug":"springcloud%e5%ad%a6%e4%b9%a0%e7%ac%94%e8%ae%b0%ef%bc%9ahystrix%e6%96%ad%e8%b7%af%e5%99%a8%e5%85%ad","status":"publish","type":"post","link":"https:\/\/blog.ttwow.top\/?p=359","title":{"rendered":"SpringCloud\u5b66\u4e60\u7b14\u8bb0\uff1aHystrix\u65ad\u8def\u5668(\u4e03)"},"content":{"rendered":"<h2>\u6982\u8ff0<\/h2>\n<h3>\u5206\u5e03\u5f0f\u7cfb\u7edf\u9762\u4e34\u7684\u95ee\u9898<\/h3>\n<p>\u590d\u6742\u5206\u5e03\u5f0f\u4f53\u7cfb\u7ed3\u6784\u4e2d\u7684\u5e94\u7528\u7a0b\u5e8f\u6709\u6570\u5341\u4e2a\u4f9d\u8d56\u5173\u7cfb\uff0c\u6bcf\u4e2a\u4f9d\u8d56\u5173\u7cfb\u5728\u67d0\u4e9b\u65f6\u5019\u5c06\u4e0d\u53ef\u907f\u514d\u5730\u5931\u8d25\u3002<\/p>\n<p>\u670d\u52a1\u96ea\u5d29<br \/>\n\u591a\u4e2a\u5fae\u670d\u52a1\u4e4b\u95f4\u8c03\u7528\u7684\u65f6\u5019\uff0c\u5047\u8bbe\u5fae\u670d\u52a1A\u8c03\u7528\u5fae\u670d\u52a1B\u548c\u5fae\u670d\u52a1C\uff0c\u5fae\u670d\u52a1B\u548c\u5fae\u670d\u52a1C\u53c8\u8c03\u7528\u5176\u5b83\u7684\u5fae\u670d\u52a1\uff0c\u8fd9\u5c31\u662f\u6240\u8c13\u7684\u201c\u6247\u51fa\u201d\u3002\u5982\u679c\u6247\u51fa\u7684\u94fe\u8def\u4e0a\u67d0\u4e2a\u5fae\u670d\u52a1\u7684\u8c03\u7528\u54cd\u5e94\u65f6\u95f4\u8fc7\u957f\u6216\u8005\u4e0d\u53ef\u7528\uff0c\u5bf9\u5fae\u670d\u52a1A\u7684\u8c03\u7528\u5c31\u4f1a\u5360\u7528\u8d8a\u6765\u8d8a\u591a\u7684\u7cfb\u7edf\u8d44\u6e90\uff0c\u8fdb\u800c\u5f15\u8d77\u7cfb\u7edf\u5d29\u6e83\uff0c\u6240\u8c13\u7684\u201c\u96ea\u5d29\u6548\u5e94\u201d.<\/p>\n<p>\u5bf9\u4e8e\u9ad8\u6d41\u91cf\u7684\u5e94\u7528\u6765\u8bf4\uff0c\u5355\u4e00\u7684\u540e\u7aef\u4f9d\u8d56\u53ef\u80fd\u4f1a\u5bfc\u81f4\u6240\u6709\u670d\u52a1\u5668\u4e0a\u7684\u6240\u6709\u8d44\u6e90\u90fd\u5728\u51e0\u79d2\u949f\u5185\u9971\u548c\u3002\u6bd4\u5931\u8d25\u66f4\u7cdf\u7cd5\u7684\u662f\uff0c\u8fd9\u4e9b\u5e94\u7528\u7a0b\u5e8f\u8fd8\u53ef\u80fd\u5bfc\u81f4\u670d\u52a1\u4e4b\u95f4\u7684\u5ef6\u8fdf\u589e\u52a0\uff0c\u5907\u4efd\u961f\u5217\uff0c\u7ebf\u7a0b\u548c\u5176\u4ed6\u7cfb\u7edf\u8d44\u6e90\u7d27\u5f20\uff0c\u5bfc\u81f4\u6574\u4e2a\u7cfb\u7edf\u53d1\u751f\u66f4\u591a\u7684\u7ea7\u8054\u6545\u969c\u3002\u8fd9\u4e9b\u90fd\u8868\u793a\u9700\u8981\u5bf9\u6545\u969c\u548c\u5ef6\u8fdf\u8fdb\u884c\u9694\u79bb\u548c\u7ba1\u7406\uff0c\u4ee5\u4fbf\u5355\u4e2a\u4f9d\u8d56\u5173\u7cfb\u7684\u5931\u8d25\uff0c\u4e0d\u80fd\u53d6\u6d88\u6574\u4e2a\u5e94\u7528\u7a0b\u5e8f\u6216\u7cfb\u7edf\u3002<\/p>\n<p>\u5907\u6ce8\uff1a\u4e00\u822c\u60c5\u51b5\u5bf9\u4e8e\u670d\u52a1\u4f9d\u8d56\u7684\u4fdd\u62a4\u4e3b\u8981\u67093\u4e2d\u89e3\u51b3\u65b9\u6848\uff1a<\/p>\n<p>\uff081\uff09\u7194\u65ad\u6a21\u5f0f\uff1a\u8fd9\u79cd\u6a21\u5f0f\u4e3b\u8981\u662f\u53c2\u8003\u7535\u8def\u7194\u65ad\uff0c\u5982\u679c\u4e00\u6761\u7ebf\u8def\u7535\u538b\u8fc7\u9ad8\uff0c\u4fdd\u9669\u4e1d\u4f1a\u7194\u65ad\uff0c\u9632\u6b62\u706b\u707e\u3002\u653e\u5230\u6211\u4eec\u7684\u7cfb\u7edf\u4e2d\uff0c\u5982\u679c\u67d0\u4e2a\u76ee\u6807\u670d\u52a1\u8c03\u7528\u6162\u6216\u8005\u6709\u5927\u91cf\u8d85\u65f6\uff0c\u6b64\u65f6\uff0c\u7194\u65ad\u8be5\u670d\u52a1\u7684\u8c03\u7528\uff0c\u5bf9\u4e8e\u540e\u7eed\u8c03\u7528\u8bf7\u6c42\uff0c\u4e0d\u5728\u7ee7\u7eed\u8c03\u7528\u76ee\u6807\u670d\u52a1\uff0c\u76f4\u63a5\u8fd4\u56de\uff0c\u5feb\u901f\u91ca\u653e\u8d44\u6e90\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u60c5\u51b5\u597d\u8f6c\u5219\u6062\u590d\u8c03\u7528\u3002<\/p>\n<p>\uff082\uff09\u9694\u79bb\u6a21\u5f0f\uff1a\u8fd9\u79cd\u6a21\u5f0f\u5c31\u50cf\u5bf9\u7cfb\u7edf\u8bf7\u6c42\u6309\u7c7b\u578b\u5212\u5206\u6210\u4e00\u4e2a\u4e2a\u5c0f\u5c9b\u7684\u4e00\u6837\uff0c\u5f53\u67d0\u4e2a\u5c0f\u5c9b\u88ab\u706b\u5c11\u5149\u4e86\uff0c\u4e0d\u4f1a\u5f71\u54cd\u5230\u5176\u4ed6\u7684\u5c0f\u5c9b\u3002\u4f8b\u5982\u53ef\u4ee5\u5bf9\u4e0d\u540c\u7c7b\u578b\u7684\u8bf7\u6c42\u4f7f\u7528\u7ebf\u7a0b\u6c60\u6765\u8d44\u6e90\u9694\u79bb\uff0c\u6bcf\u79cd\u7c7b\u578b\u7684\u8bf7\u6c42\u4e92\u4e0d\u5f71\u54cd\uff0c\u5982\u679c\u4e00\u79cd\u7c7b\u578b\u7684\u8bf7\u6c42\u7ebf\u7a0b\u8d44\u6e90\u8017\u5c3d\uff0c\u5219\u5bf9\u540e\u7eed\u7684\u8be5\u7c7b\u578b\u8bf7\u6c42\u76f4\u63a5\u8fd4\u56de\uff0c\u4e0d\u518d\u8c03\u7528\u540e\u7eed\u8d44\u6e90\u3002\u8fd9\u79cd\u6a21\u5f0f\u4f7f\u7528\u573a\u666f\u975e\u5e38\u591a\uff0c\u4f8b\u5982\u5c06\u4e00\u4e2a\u670d\u52a1\u62c6\u5f00\uff0c\u5bf9\u4e8e\u91cd\u8981\u7684\u670d\u52a1\u4f7f\u7528\u5355\u72ec\u670d\u52a1\u5668\u6765\u90e8\u7f72\uff0c\u518d\u6216\u8005\u516c\u53f8\u6700\u8fd1\u63a8\u5e7f\u7684\u591a\u4e2d\u5fc3\u3002<\/p>\n<p>\uff083\uff09\u9650\u6d41\u6a21\u5f0f\uff1a\u4e0a\u8ff0\u7684\u7194\u65ad\u6a21\u5f0f\u548c\u9694\u79bb\u6a21\u5f0f\u90fd\u5c5e\u4e8e\u51fa\u9519\u540e\u7684\u5bb9\u9519\u5904\u7406\u673a\u5236\uff0c\u800c\u9650\u6d41\u6a21\u5f0f\u5219\u53ef\u4ee5\u79f0\u4e3a\u9884\u9632\u6a21\u5f0f\u3002\u9650\u6d41\u6a21\u5f0f\u4e3b\u8981\u662f\u63d0\u524d\u5bf9\u5404\u4e2a\u7c7b\u578b\u7684\u8bf7\u6c42\u8bbe\u7f6e\u6700\u9ad8\u7684QPS\u9608\u503c\uff0c\u82e5\u9ad8\u4e8e\u8bbe\u7f6e\u7684\u9608\u503c\u5219\u5bf9\u8be5\u8bf7\u6c42\u76f4\u63a5\u8fd4\u56de\uff0c\u4e0d\u518d\u8c03\u7528\u540e\u7eed\u8d44\u6e90\u3002\u8fd9\u79cd\u6a21\u5f0f\u4e0d\u80fd\u89e3\u51b3\u670d\u52a1\u4f9d\u8d56\u7684\u95ee\u9898\uff0c\u53ea\u80fd\u89e3\u51b3\u7cfb\u7edf\u6574\u4f53\u8d44\u6e90\u5206\u914d\u95ee\u9898\uff0c\u56e0\u4e3a\u6ca1\u6709\u88ab\u9650\u6d41\u7684\u8bf7\u6c42\u4f9d\u7136\u6709\u53ef\u80fd\u9020\u6210\u96ea\u5d29\u6548\u5e94\u3002<\/p>\n<h3>Hystrix\u4ecb\u7ecd<\/h3>\n<p>Hystrix\u662f\u4e00\u4e2a\u7528\u4e8e\u5904\u7406\u5206\u5e03\u5f0f\u7cfb\u7edf\u7684\u5ef6\u8fdf\u548c\u5bb9\u9519\u7684\u5f00\u6e90\u5e93\uff0c\u5728\u5206\u5e03\u5f0f\u7cfb\u7edf\u91cc\uff0c\u8bb8\u591a\u4f9d\u8d56\u4e0d\u53ef\u907f\u514d\u7684\u4f1a\u8c03\u7528\u5931\u8d25\uff0c\u6bd4\u5982\u8d85\u65f6\u3001\u5f02\u5e38\u7b49\uff0cHystrix\u80fd\u591f\u4fdd\u8bc1\u5728\u4e00\u4e2a\u4f9d\u8d56\u51fa\u95ee\u9898\u7684\u60c5\u51b5\u4e0b\uff0c\u4e0d\u4f1a\u5bfc\u81f4\u6574\u4f53\u670d\u52a1\u5931\u8d25\uff0c\u907f\u514d\u7ea7\u8054\u6545\u969c\uff0c\u4ee5\u63d0\u9ad8\u5206\u5e03\u5f0f\u7cfb\u7edf\u7684\u5f39\u6027\u3002<\/p>\n<p>\u201c\u65ad\u8def\u5668\u201d\u672c\u8eab\u662f\u4e00\u79cd\u5f00\u5173\u88c5\u7f6e\uff0c\u5f53\u67d0\u4e2a\u670d\u52a1\u5355\u5143\u53d1\u751f\u6545\u969c\u4e4b\u540e\uff0c\u901a\u8fc7\u65ad\u8def\u5668\u7684\u6545\u969c\u76d1\u63a7\uff08\u7c7b\u4f3c\u7194\u65ad\u4fdd\u9669\u4e1d\uff09\uff0c\u5411\u8c03\u7528\u65b9\u8fd4\u56de\u4e00\u4e2a\u7b26\u5408\u9884\u671f\u7684\u3001\u53ef\u5904\u7406\u7684\u5907\u9009\u54cd\u5e94\uff08FallBack\uff09\uff0c\u800c\u4e0d\u662f\u957f\u65f6\u95f4\u7684\u7b49\u5f85\u6216\u8005\u629b\u51fa\u8c03\u7528\u65b9\u65e0\u6cd5\u5904\u7406\u7684\u5f02\u5e38\uff0c\u8fd9\u6837\u5c31\u4fdd\u8bc1\u4e86\u670d\u52a1\u8c03\u7528\u65b9\u7684\u7ebf\u7a0b\u4e0d\u4f1a\u88ab\u957f\u65f6\u95f4\u3001\u4e0d\u5fc5\u8981\u5730\u5360\u7528\uff0c\u4ece\u800c\u907f\u514d\u4e86\u6545\u969c\u5728\u5206\u5e03\u5f0f\u7cfb\u7edf\u4e2d\u7684\u8513\u5ef6\uff0c\u4e43\u81f3\u96ea\u5d29\u3002<\/p>\n<h3>Hystrix \u80fd\u5e72\u561b<\/h3>\n<h4>\u670d\u52a1\u964d\u7ea7<\/h4>\n<p>\u5907\u6ce8\uff1aHystrix\u670d\u52a1\u964d\u7ea7\uff0c\u5176\u5b9e\u5c31\u662f\u7ebf\u7a0b\u6c60\u4e2d\u5355\u4e2a\u7ebf\u7a0b\u969c\u5904\u7406\uff0c\u9632\u6b62\u5355\u4e2a\u7ebf\u7a0b\u8bf7\u6c42\u65f6\u95f4\u592a\u957f\uff0c\u5bfc\u81f4\u8d44\u6e90\u957f\u671f\u88ab\u5360\u6709\u800c\u5f97\u4e0d\u5230\u91ca\u653e\uff0c\u4ece\u800c\u5bfc\u81f4\u7ebf\u7a0b\u6c60\u88ab\u5feb\u901f\u5360\u7528\u5b8c\uff0c\u5bfc\u81f4\u670d\u52a1\u5d29\u6e83\u3002<br \/>\nHystrix\u80fd\u89e3\u51b3\u5982\u4e0b\u95ee\u9898\uff1a<br \/>\n1.\u8bf7\u6c42\u8d85\u65f6\u964d\u7ea7\uff0c\u7ebf\u7a0b\u8d44\u6e90\u4e0d\u8db3\u964d\u7ea7\uff0c\u964d\u7ea7\u4e4b\u540e\u53ef\u4ee5\u8fd4\u56de\u81ea\u5b9a\u4e49\u6570\u636e<br \/>\n2.\u7ebf\u7a0b\u6c60\u9694\u79bb\u964d\u7ea7\uff0c\u5206\u5e03\u5f0f\u670d\u52a1\u53ef\u4ee5\u9488\u5bf9\u4e0d\u540c\u7684\u670d\u52a1\u4f7f\u7528\u4e0d\u540c\u7684\u7ebf\u7a0b\u6c60\uff0c\u4ece\u800c\u4e92\u4e0d\u5f71\u54cd<br \/>\n3.\u81ea\u52a8\u89e6\u53d1\u964d\u7ea7\u4e0e\u6062\u590d<br \/>\n4.\u5b9e\u73b0\u8bf7\u6c42\u7f13\u5b58\u548c\u8bf7\u6c42\u5408\u5e76<\/p>\n<h4>\u670d\u52a1\u7194\u65ad<\/h4>\n<p>\u5907\u6ce8\uff1a\u7194\u65ad\u6a21\u5f0f\uff1a\u8fd9\u79cd\u6a21\u5f0f\u4e3b\u8981\u662f\u53c2\u8003\u7535\u8def\u7194\u65ad\uff0c\u5982\u679c\u4e00\u6761\u7ebf\u8def\u7535\u538b\u8fc7\u9ad8\uff0c\u4fdd\u9669\u4e1d\u4f1a\u7194\u65ad\uff0c\u9632\u6b62\u706b\u707e\u3002\u653e\u5230\u6211\u4eec\u7684\u7cfb\u7edf\u4e2d\uff0c\u5982\u679c\u67d0\u4e2a\u76ee\u6807\u670d\u52a1\u8c03\u7528\u6162\u6216\u8005\u6709\u5927\u91cf\u8d85\u65f6\uff0c\u6b64\u65f6\uff0c\u7194\u65ad\u8be5\u670d\u52a1\u7684\u8c03\u7528\uff0c\u5bf9\u4e8e\u540e\u7eed\u8c03\u7528\u8bf7\u6c42\uff0c\u4e0d\u5728\u7ee7\u7eed\u8c03\u7528\u76ee\u6807\u670d\u52a1\uff0c\u76f4\u63a5\u8fd4\u56de\uff0c\u5feb\u901f\u91ca\u653e\u8d44\u6e90\u3002\u5982\u679c\u76ee\u6807\u670d\u52a1\u60c5\u51b5\u597d\u8f6c\u5219\u6062\u590d\u8c03\u7528\u3002<\/p>\n<h4>\u670d\u52a1\u9650\u6d41<\/h4>\n<p>\u5907\u6ce8\uff1a\u9650\u6d41\u6a21\u5f0f\u4e3b\u8981\u662f\u63d0\u524d\u5bf9\u5404\u4e2a\u7c7b\u578b\u7684\u8bf7\u6c42\u8bbe\u7f6e\u6700\u9ad8\u7684QPS\u9608\u503c\uff0c\u82e5\u9ad8\u4e8e\u8bbe\u7f6e\u7684\u9608\u503c\u5219\u5bf9\u8be5\u8bf7\u6c42\u76f4\u63a5\u8fd4\u56de\uff0c\u4e0d\u518d\u8c03\u7528\u540e\u7eed\u8d44\u6e90\u3002\u8fd9\u79cd\u6a21\u5f0f\u4e0d\u80fd\u89e3\u51b3\u670d\u52a1\u4f9d\u8d56\u7684\u95ee\u9898\uff0c\u53ea\u80fd\u89e3\u51b3\u7cfb\u7edf\u6574\u4f53\u8d44\u6e90\u5206\u914d\u95ee\u9898\uff0c\u56e0\u4e3a\u6ca1\u6709\u88ab\u9650\u6d41\u7684\u8bf7\u6c42\u4f9d\u7136\u6709\u53ef\u80fd\u9020\u6210\u96ea\u5d29\u6548\u5e94\u3002<\/p>\n<h4>\u63a5\u8fd1\u5b9e\u65f6\u7684\u76d1\u63a7<\/h4>\n<h4>\u3002\u3002\u3002\u3002\u3002\u3002<\/h4>\n<h3>\u5b98\u7f51\u8d44\u6599<\/h3>\n<p><a href=\"https:\/\/github.com\/Netflix\/Hystrix\/wiki\/How-To-Use\">https:\/\/github.com\/Netflix\/Hystrix\/wiki\/How-To-Use<\/a><\/p>\n<h2>\u670d\u52a1\u7194\u65ad<\/h2>\n<h3>\u670d\u52a1\u7194\u65ad\u662f\u4ec0\u4e48<\/h3>\n<p>\u7194\u65ad\u673a\u5236\u662f\u5e94\u5bf9\u96ea\u5d29\u6548\u5e94\u7684\u4e00\u79cd\u5fae\u670d\u52a1\u94fe\u8def\u4fdd\u62a4\u673a\u5236\u3002<br \/>\n\u5f53\u6247\u51fa\u94fe\u8def\u7684\u67d0\u4e2a\u5fae\u670d\u52a1\u4e0d\u53ef\u7528\u6216\u8005\u54cd\u5e94\u65f6\u95f4\u592a\u957f\u65f6\uff0c\u4f1a\u8fdb\u884c\u670d\u52a1\u7684\u964d\u7ea7\uff0c\u8fdb\u800c\u7194\u65ad\u8be5\u8282\u70b9\u5fae\u670d\u52a1\u7684\u8c03\u7528\uff0c\u5feb\u901f\u8fd4\u56de&quot;\u9519\u8bef&quot;\u7684\u54cd\u5e94\u4fe1\u606f\u3002\u5f53\u68c0\u6d4b\u5230\u8be5\u8282\u70b9\u5fae\u670d\u52a1\u8c03\u7528\u54cd\u5e94\u6b63\u5e38\u540e\u6062\u590d\u8c03\u7528\u94fe\u8def\u3002\u5728SpringCloud\u6846\u67b6\u91cc\u7194\u65ad\u673a\u5236\u901a\u8fc7Hystrix\u5b9e\u73b0\u3002Hystrix\u4f1a\u76d1\u63a7\u5fae\u670d\u52a1\u95f4\u8c03\u7528\u7684\u72b6\u51b5\uff0c\u5f53\u5931\u8d25\u7684\u8c03\u7528\u5230\u4e00\u5b9a\u9608\u503c\uff0c\u7f3a\u7701\u662f5\u79d2\u518520\u6b21\u8c03\u7528\u5931\u8d25\u5c31\u4f1a\u542f\u52a8\u7194\u65ad\u673a\u5236\u3002\u7194\u65ad\u673a\u5236\u7684\u6ce8\u89e3\u662f@HystrixCommand\u3002<\/p>\n<h3>\u65b0\u5efamicroservicecloud-provider-dept-hystrix-8001<\/h3>\n<p>\u53c2\u8003microservicecloud-provider-dept-8001<\/p>\n<h3>\u4fee\u6539\u5185\u5bb9POM<\/h3>\n<pre><code class=\"language-xml\">&lt;!--  hystrix --&gt;\n&lt;dependency&gt;\n    &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;\n    &lt;artifactId&gt;spring-cloud-starter-hystrix&lt;\/artifactId&gt;\n&lt;\/dependency&gt;<\/code><\/pre>\n<h3>YML<\/h3>\n<pre><code class=\"language-yaml\">instance-id: microservicecloud-dept8001-hystrix   #\u81ea\u5b9a\u4e49\u670d\u52a1\u540d\u79f0\u4fe1\u606f<\/code><\/pre>\n<h3>\u4fee\u6539DeptController<\/h3>\n<pre><code class=\"language-java\">@RestController\npublic class DeptController\n{\n    @Autowired\n    private DeptService service = null;\n\n    @RequestMapping(value=&quot;\/dept\/get\/{id}&quot;,method=RequestMethod.GET)\n    @HystrixCommand(fallbackMethod = &quot;processHystrix_Get&quot;)\n    public Dept get(@PathVariable(&quot;id&quot;) Long id)\n    {\n        Dept dept =  this.service.get(id);\n        if(null == dept)\n        {\n            throw new RuntimeException(&quot;\u8be5ID\uff1a&quot;+id+&quot;\u6ca1\u6709\u6ca1\u6709\u5bf9\u5e94\u7684\u4fe1\u606f&quot;);\n        }\n        return dept;\n    }\n\n    public Dept processHystrix_Get(@PathVariable(&quot;id&quot;) Long id)\n    {\n        return new Dept().setDeptno(id)\n            .setDname(&quot;\u8be5ID\uff1a&quot;+id+&quot;\u6ca1\u6709\u6ca1\u6709\u5bf9\u5e94\u7684\u4fe1\u606f,null--@HystrixCommand&quot;)\n            .setDb_source(&quot;no this database in MySQL&quot;);\n    }\n}<\/code><\/pre>\n<p>@HystrixCommand\u62a5\u5f02\u5e38\u540e\u5982\u4f55\u5904\u7406<\/p>\n<p>\u4e00\u65e6\u8c03\u7528\u670d\u52a1\u65b9\u6cd5\u5931\u8d25\u5e76\u629b\u51fa\u4e86\u9519\u8bef\u4fe1\u606f\u540e\uff0c\u4f1a\u81ea\u52a8\u8c03\u7528@HystrixCommand\u6807\u6ce8\u597d\u7684fallbackMethod\u8c03\u7528\u7c7b\u4e2d\u7684\u6307\u5b9a\u65b9\u6cd5<\/p>\n<h3>\u4fee\u6539\u4e3b\u542f\u52a8\u7c7bDeptProvider8001_Hystrix_App\u5e76\u6dfb\u52a0\u65b0\u6ce8\u89e3@EnableCircuitBreaker<\/h3>\n<h3>\u6d4b\u8bd5<\/h3>\n<p>3\u4e2aeureka\u5148\u542f\u52a8<\/p>\n<p>\u4e3b\u542f\u52a8\u7c7bDeptProvider8001_Hystrix_App<\/p>\n<p>Consumer\u542f\u52a8microservicecloud-consumer-dept-80<\/p>\n<p><a href=\"http:\/\/localhost\/consumer\/dept\/get\/112\">http:\/\/localhost\/consumer\/dept\/get\/112<\/a><\/p>\n<p>\u54cd\u5e94\u7ed3\u679c<\/p>\n<pre><code class=\"language-json\">{&quot;deptno&quot;:111,&quot;dname&quot;:&quot;\u8be5ID\uff1a111\u6ca1\u6709\u6ca1\u6709\u5bf9\u5e94\u7684\u4fe1\u606f,null--@HystrixCommand&quot;,&quot;db_source&quot;:&quot;no this database in MySQL&quot;}<\/code><\/pre>\n<h2>\u670d\u52a1\u964d\u7ea7<\/h2>\n<h3>\u662f\u4ec0\u4e48<\/h3>\n<p>\u6574\u4f53\u8d44\u6e90\u5feb\u4e0d\u591f\u4e86\uff0c\u5fcd\u75db\u5c06\u67d0\u4e9b\u670d\u52a1\u5148\u5173\u6389\uff0c\u5f85\u6e21\u8fc7\u96be\u5173\uff0c\u518d\u5f00\u542f\u56de\u6765\u3002<\/p>\n<p>\u670d\u52a1\u964d\u7ea7\u5904\u7406\u662f\u5728\u5ba2\u6237\u7aef\u5b9e\u73b0\u5b8c\u6210\u7684\uff0c\u4e0e\u670d\u52a1\u7aef\u6ca1\u6709\u5173\u7cfb<\/p>\n<p>\u4fee\u6539microservicecloud-api\u5de5\u7a0b\uff0c<br \/>\n\u6839\u636e\u5df2\u7ecf\u6709\u7684DeptClientService\u63a5\u53e3\u65b0\u5efa\u4e00\u4e2a\u5b9e\u73b0\u4e86<br \/>\nFallbackFactory\u63a5\u53e3\u7684\u7c7bDeptClientServiceFallbackFactory<\/p>\n<pre><code class=\"language-java\">@Component\/\/\u4e0d\u8981\u5fd8\u8bb0\u6dfb\u52a0\uff0c\u4e0d\u8981\u5fd8\u8bb0\u6dfb\u52a0\npublic class DeptClientServiceFallbackFactory implements FallbackFactory&lt;DeptClientService&gt;\n{\n    @Override\n    public DeptClientService create(Throwable throwable)\n    {\n        return new DeptClientService() {\n            @Override\n            public Dept get(long id)\n            {\n                return new Dept().setDeptno(id)\n                    .setDname(&quot;\u8be5ID\uff1a&quot;+id+&quot;\u6ca1\u6709\u6ca1\u6709\u5bf9\u5e94\u7684\u4fe1\u606f,Consumer\u5ba2\u6237\u7aef\u63d0\u4f9b\u7684\u964d\u7ea7\u4fe1\u606f,\u6b64\u523b\u670d\u52a1Provider\u5df2\u7ecf\u5173\u95ed&quot;)\n                    .setDb_source(&quot;no this database in MySQL&quot;);\n            }\n\n            @Override\n            public List&lt;Dept&gt; list()\n            {\n                return null;\n            }\n\n            @Override\n            public boolean add(Dept dept)\n            {\n                return false;\n            }\n        };\n    }\n}<\/code><\/pre>\n<p>\u4fee\u6539microservicecloud-api\u5de5\u7a0b\uff0cDeptClientService\u63a5\u53e3\u5728\u6ce8\u89e3@FeignClient\u4e2d\u6dfb\u52a0fallbackFactory\u5c5e\u6027\u503c<\/p>\n<pre><code class=\"language-java\">@FeignClient(value = &quot;MICROSERVICECLOUD-DEPT&quot;,fallbackFactory=DeptClientServiceFallbackFactory.class)<\/code><\/pre>\n<p>microservicecloud-api\u5de5\u7a0b<\/p>\n<p>mvn clean install<\/p>\n<p>microservicecloud-consumer-dept-feign\u5de5\u7a0b\u4fee\u6539YML<\/p>\n<pre><code class=\"language-yaml\">feign:\n  hystrix:\n    enabled: true\n<\/code><\/pre>\n<p>\u6d4b\u8bd5<\/p>\n<p>3\u4e2aeureka\u5148\u542f\u52a8<\/p>\n<p>\u5fae\u670d\u52a1microservicecloud-provider-dept-8001\u542f\u52a8<\/p>\n<p>microservicecloud-consumer-dept-feign\u542f\u52a8<\/p>\n<p>\u6b63\u5e38\u8bbf\u95ee\u6d4b\u8bd5:<a href=\"http:\/\/localhost\/consumer\/dept\/get\/1\">http:\/\/localhost\/consumer\/dept\/get\/1<\/a><\/p>\n<p>\u6545\u610f\u5173\u95ed\u5fae\u670d\u52a1microservicecloud-provider-dept-8001<\/p>\n<p>\u5ba2\u6237\u7aef\u81ea\u5df1\u8c03\u7528\u63d0\u793a<\/p>\n<p><a href=\"http:\/\/localhost\/consumer\/dept\/get\/1\">http:\/\/localhost\/consumer\/dept\/get\/1<\/a><\/p>\n<pre><code class=\"language-json\">{&quot;deptno&quot;:1,&quot;dname&quot;:&quot;\u8be5ID\uff1a1\u6ca1\u6709\u6ca1\u6709\u5bf9\u5e94\u7684\u4fe1\u606f,Consumer\u5ba2\u6237\u7aef\u63d0\u4f9b\u7684\u964d\u7ea7\u4fe1\u606f,\u6b64\u523b\u670d\u52a1Provider\u5df2\u7ecf\u5173\u95ed&quot;,&quot;db_source&quot;:&quot;no this database in MySQL&quot;}<\/code><\/pre>\n<p>\u6b64\u65f6\u670d\u52a1\u7aefprovider\u5df2\u7ecfdown\u4e86\uff0c\u4f46\u662f\u6211\u4eec\u505a\u4e86\u670d\u52a1\u964d\u7ea7\u5904\u7406\uff0c\u8ba9\u5ba2\u6237\u7aef\u5728\u670d\u52a1\u7aef\u4e0d\u53ef\u7528\u65f6\u4e5f\u4f1a\u83b7\u5f97\u63d0\u793a\u4fe1\u606f\u800c\u4e0d\u4f1a\u6302\u8d77\u8017\u6b7b\u670d\u52a1\u5668<\/p>\n<h2>\u670d\u52a1\u76d1\u63a7hystrixDashboard<\/h2>\n<h3>\u6982\u5ff5<\/h3>\n<p>\u9664\u4e86\u9694\u79bb\u4f9d\u8d56\u670d\u52a1\u7684\u8c03\u7528\u4ee5\u5916\uff0cHystrix\u8fd8\u63d0\u4f9b\u4e86\u51c6\u5b9e\u65f6\u7684\u8c03\u7528\u76d1\u63a7\uff08Hystrix Dashboard\uff09\uff0cHystrix\u4f1a\u6301\u7eed\u5730\u8bb0\u5f55\u6240\u6709\u901a\u8fc7Hystrix\u53d1\u8d77\u7684\u8bf7\u6c42\u7684\u6267\u884c\u4fe1\u606f\uff0c\u5e76\u4ee5\u7edf\u8ba1\u62a5\u8868\u548c\u56fe\u5f62\u7684\u5f62\u5f0f\u5c55\u793a\u7ed9\u7528\u6237\uff0c\u5305\u62ec\u6bcf\u79d2\u6267\u884c\u591a\u5c11\u8bf7\u6c42\u591a\u5c11\u6210\u529f\uff0c\u591a\u5c11\u5931\u8d25\u7b49\u3002Netflix\u901a\u8fc7hystrix-metrics-event-stream\u9879\u76ee\u5b9e\u73b0\u4e86\u5bf9\u4ee5\u4e0a\u6307\u6807\u7684\u76d1\u63a7\u3002Spring Cloud\u4e5f\u63d0\u4f9b\u4e86Hystrix Dashboard\u7684\u6574\u5408\uff0c\u5bf9\u76d1\u63a7\u5185\u5bb9\u8f6c\u5316\u6210\u53ef\u89c6\u5316\u754c\u9762\u3002<\/p>\n<h3>Case\u6b65\u9aa4<\/h3>\n<p>\u65b0\u5efa\u5de5\u7a0bmicroservicecloud-consumer-hystrix-dashboard<\/p>\n<p>POM<\/p>\n<pre><code class=\"language-xml\">&lt;dependencies&gt;\n    &lt;!-- \u81ea\u5df1\u5b9a\u4e49\u7684api --&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;com.example&lt;\/groupId&gt;\n        &lt;artifactId&gt;microservicecloud-api&lt;\/artifactId&gt;\n        &lt;version&gt;${project.version}&lt;\/version&gt;\n    &lt;\/dependency&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n        &lt;artifactId&gt;spring-boot-starter-web&lt;\/artifactId&gt;\n    &lt;\/dependency&gt;\n    &lt;!-- \u4fee\u6539\u540e\u7acb\u5373\u751f\u6548\uff0c\u70ed\u90e8\u7f72 --&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;org.springframework&lt;\/groupId&gt;\n        &lt;artifactId&gt;springloaded&lt;\/artifactId&gt;\n    &lt;\/dependency&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n        &lt;artifactId&gt;spring-boot-devtools&lt;\/artifactId&gt;\n    &lt;\/dependency&gt;\n    &lt;!-- Ribbon\u76f8\u5173 --&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;\n        &lt;artifactId&gt;spring-cloud-starter-eureka&lt;\/artifactId&gt;\n    &lt;\/dependency&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;\n        &lt;artifactId&gt;spring-cloud-starter-ribbon&lt;\/artifactId&gt;\n    &lt;\/dependency&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;\n        &lt;artifactId&gt;spring-cloud-starter-config&lt;\/artifactId&gt;\n    &lt;\/dependency&gt;\n    &lt;!-- feign\u76f8\u5173 --&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;\n        &lt;artifactId&gt;spring-cloud-starter-feign&lt;\/artifactId&gt;\n    &lt;\/dependency&gt;\n    &lt;!-- hystrix\u548c hystrix-dashboard\u76f8\u5173--&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;\n        &lt;artifactId&gt;spring-cloud-starter-hystrix&lt;\/artifactId&gt;\n    &lt;\/dependency&gt;\n    &lt;dependency&gt;\n        &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;\n        &lt;artifactId&gt;spring-cloud-starter-hystrix-dashboard&lt;\/artifactId&gt;\n    &lt;\/dependency&gt;\n&lt;\/dependencies&gt;<\/code><\/pre>\n<p>YML<\/p>\n<pre><code class=\"language-yaml\">server:\n  port: 9001<\/code><\/pre>\n<p>\u4e3b\u542f\u52a8\u7c7b\u6539\u540d+\u65b0\u6ce8\u89e3@EnableHystrixDashboard<\/p>\n<pre><code class=\"language-java\">@SpringBootApplication\n@EnableHystrixDashboard\npublic class DeptConsumer_DashBoard_App\n{\n    public static void main(String[] args)\n    {\n        SpringApplication.run(DeptConsumer_DashBoard_App.class,args);\n    }\n}<\/code><\/pre>\n<p>\u6240\u6709Provider\u5fae\u670d\u52a1\u63d0\u4f9b\u7c7b(8001\/8002\/8003)\u90fd\u9700\u8981\u76d1\u63a7\u4f9d\u8d56\u914d\u7f6e<\/p>\n<pre><code class=\"language-xml\">&lt;!-- actuator\u76d1\u63a7\u4fe1\u606f\u5b8c\u5584 --&gt;\n   &lt;dependency&gt;\n     &lt;groupId&gt;org.springframework.boot&lt;\/groupId&gt;\n     &lt;artifactId&gt;spring-boot-starter-actuator&lt;\/artifactId&gt;\n   &lt;\/dependency&gt;<\/code><\/pre>\n<p>\u542f\u52a8microservicecloud-consumer-hystrix-dashboard\u8be5\u5fae\u670d\u52a1\u76d1\u63a7\u6d88\u8d39\u7aef<\/p>\n<p><a href=\"http:\/\/localhost:9001\/hystrix\">http:\/\/localhost:9001\/hystrix<\/a><\/p>\n<p>\u542f\u52a83\u4e2aeureka\u96c6\u7fa4<\/p>\n<p>\u542f\u52a8microservicecloud-provider-dept-hystrix-8001<\/p>\n<p><a href=\"http:\/\/localhost:8001\/dept\/get\/1\">http:\/\/localhost:8001\/dept\/get\/1<\/a><\/p>\n<p><a href=\"http:\/\/localhost:8001\/hystrix.stream\">http:\/\/localhost:8001\/hystrix.stream<\/a><\/p>\n<pre><code class=\"language-json\">ping:\n\ndata: {&quot;type&quot;:&quot;HystrixCommand&quot;,&quot;name&quot;:&quot;get&quot;,&quot;group&quot;:&quot;DeptController&quot;,&quot;currentTime&quot;:1650432716414,&quot;isCircuitBreakerOpen&quot;:false,&quot;errorPercentage&quot;:0,&quot;errorCount&quot;:0,&quot;requestCount&quot;:0,&quot;rollingCountBadRequests&quot;:0,&quot;rollingCountCollapsedRequests&quot;:0,&quot;rollingCountEmit&quot;:0,&quot;rollingCountExceptionsThrown&quot;:0,&quot;rollingCountFailure&quot;:0,&quot;rollingCountFallbackEmit&quot;:0,&quot;rollingCountFallbackFailure&quot;:0,&quot;rollingCountFallbackMissing&quot;:0,&quot;rollingCountFallbackRejection&quot;:0,&quot;rollingCountFallbackSuccess&quot;:0,&quot;rollingCountResponsesFromCache&quot;:0,&quot;rollingCountSemaphoreRejected&quot;:0,&quot;rollingCountShortCircuited&quot;:0,&quot;rollingCountSuccess&quot;:0,&quot;rollingCountThreadPoolRejected&quot;:0,&quot;rollingCountTimeout&quot;:0,&quot;currentConcurrentExecutionCount&quot;:0,&quot;rollingMaxConcurrentExecutionCount&quot;:0,&quot;latencyExecute_mean&quot;:0,&quot;latencyExecute&quot;:{&quot;0&quot;:0,&quot;25&quot;:0,&quot;50&quot;:0,&quot;75&quot;:0,&quot;90&quot;:0,&quot;95&quot;:0,&quot;99&quot;:0,&quot;99.5&quot;:0,&quot;100&quot;:0},&quot;latencyTotal_mean&quot;:0,&quot;latencyTotal&quot;:{&quot;0&quot;:0,&quot;25&quot;:0,&quot;50&quot;:0,&quot;75&quot;:0,&quot;90&quot;:0,&quot;95&quot;:0,&quot;99&quot;:0,&quot;99.5&quot;:0,&quot;100&quot;:0},&quot;propertyValue_circuitBreakerRequestVolumeThreshold&quot;:20,&quot;propertyValue_circuitBreakerSleepWindowInMilliseconds&quot;:5000,&quot;propertyValue_circuitBreakerErrorThresholdPercentage&quot;:50,&quot;propertyValue_circuitBreakerForceOpen&quot;:false,&quot;propertyValue_circuitBreakerForceClosed&quot;:false,&quot;propertyValue_circuitBreakerEnabled&quot;:true,&quot;propertyValue_executionIsolationStrategy&quot;:&quot;THREAD&quot;,&quot;propertyValue_executionIsolationThreadTimeoutInMilliseconds&quot;:1000,&quot;propertyValue_executionTimeoutInMilliseconds&quot;:1000,&quot;propertyValue_executionIsolationThreadInterruptOnTimeout&quot;:true,&quot;propertyValue_executionIsolationThreadPoolKeyOverride&quot;:null,&quot;propertyValue_executionIsolationSemaphoreMaxConcurrentRequests&quot;:10,&quot;propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests&quot;:10,&quot;propertyValue_metricsRollingStatisticalWindowInMilliseconds&quot;:10000,&quot;propertyValue_requestCacheEnabled&quot;:true,&quot;propertyValue_requestLogEnabled&quot;:true,&quot;reportingHosts&quot;:1,&quot;threadPool&quot;:&quot;DeptController&quot;}\n\ndata: {&quot;type&quot;:&quot;HystrixThreadPool&quot;,&quot;name&quot;:&quot;DeptController&quot;,&quot;currentTime&quot;:1650432716424,&quot;currentActiveCount&quot;:0,&quot;currentCompletedTaskCount&quot;:1,&quot;currentCorePoolSize&quot;:10,&quot;currentLargestPoolSize&quot;:1,&quot;currentMaximumPoolSize&quot;:10,&quot;currentPoolSize&quot;:1,&quot;currentQueueSize&quot;:0,&quot;currentTaskCount&quot;:1,&quot;rollingCountThreadsExecuted&quot;:0,&quot;rollingMaxActiveThreads&quot;:0,&quot;rollingCountCommandRejections&quot;:0,&quot;propertyValue_queueSizeRejectionThreshold&quot;:5,&quot;propertyValue_metricsRollingStatisticalWindowInMilliseconds&quot;:10000,&quot;reportingHosts&quot;:1}<\/code><\/pre>\n<p>\u542f\u52a8\u7684\u76f8\u5173\u5fae\u670d\u52a1\u5de5\u7a0b<\/p>\n<p>\u76d1\u63a7\u6d4b\u8bd5<\/p>\n<p>\u591a\u6b21\u5237\u65b0http:\/\/localhost:8001\/dept\/get\/1<\/p>\n<p>\u89c2\u5bdf\u76d1\u63a7\u7a97\u53e3<\/p>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/bucket-blog-img.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2022\/04\/image-1650458923393.png'><img class=\"lazyload lazyload-style-11\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/bucket-blog-img.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2022\/04\/image-1650458923393.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"file\" \/><\/div><\/p>\n<p>\u5982\u4f55\u770b\uff1f<\/p>\n<p>7\u8272<\/p>\n<p>1\u5708<\/p>\n<p>\u5b9e\u5fc3\u5706\uff1a\u5171\u6709\u4e24\u79cd\u542b\u4e49\u3002\u5b83\u901a\u8fc7\u989c\u8272\u7684\u53d8\u5316\u4ee3\u8868\u4e86\u5b9e\u4f8b\u7684\u5065\u5eb7\u7a0b\u5ea6\uff0c\u5b83\u7684\u5065\u5eb7\u5ea6\u4ece\u7eff\u8272&lt;\u9ec4\u8272&lt;\u6a59\u8272&lt;\u7ea2\u8272\u9012\u51cf\u3002<br \/>\n\u8be5\u5b9e\u5fc3\u5706\u9664\u4e86\u989c\u8272\u7684\u53d8\u5316\u4e4b\u5916\uff0c\u5b83\u7684\u5927\u5c0f\u4e5f\u4f1a\u6839\u636e\u5b9e\u4f8b\u7684\u8bf7\u6c42\u6d41\u91cf\u53d1\u751f\u53d8\u5316\uff0c\u6d41\u91cf\u8d8a\u5927\u8be5\u5b9e\u5fc3\u5706\u5c31\u8d8a\u5927\u3002\u6240\u4ee5\u901a\u8fc7\u8be5\u5b9e\u5fc3\u5706\u7684\u5c55\u793a\uff0c\u5c31\u53ef\u4ee5\u5728\u5927\u91cf\u7684\u5b9e\u4f8b\u4e2d\u5feb\u901f\u7684\u53d1\u73b0\u6545\u969c\u5b9e\u4f8b\u548c\u9ad8\u538b\u529b\u5b9e\u4f8b\u3002<\/p>\n<p>1\u7ebf<\/p>\n<p>\u66f2\u7ebf\uff1a\u7528\u6765\u8bb0\u5f552\u5206\u949f\u5185\u6d41\u91cf\u7684\u76f8\u5bf9\u53d8\u5316\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b83\u6765\u89c2\u5bdf\u5230\u6d41\u91cf\u7684\u4e0a\u5347\u548c\u4e0b\u964d\u8d8b\u52bf\u3002<\/p>\n<p>\u6574\u56fe\u8bf4\u660e<\/p>\n<p><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/bucket-blog-img.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2022\/04\/image-1650458963195.png'><img class=\"lazyload lazyload-style-11\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/bucket-blog-img.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2022\/04\/image-1650458963195.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"file\" \/><\/div><\/p>\n<p>\u590d\u6742\u7684<br \/>\n<div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/bucket-blog-img.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2022\/04\/image-1650459112655.png'><img class=\"lazyload lazyload-style-11\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/bucket-blog-img.oss-cn-shanghai.aliyuncs.com\/wp-content\/uploads\/2022\/04\/image-1650459112655.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"file\" \/><\/div><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8ff0 \u5206\u5e03\u5f0f\u7cfb\u7edf\u9762\u4e34\u7684\u95ee\u9898 \u590d\u6742\u5206\u5e03\u5f0f\u4f53\u7cfb\u7ed3\u6784\u4e2d\u7684\u5e94\u7528\u7a0b\u5e8f\u6709\u6570\u5341\u4e2a\u4f9d\u8d56\u5173\u7cfb\uff0c\u6bcf\u4e2a\u4f9d\u8d56\u5173\u7cfb\u5728\u67d0\u4e9b\u65f6\u5019\u5c06\u4e0d\u53ef\u907f\u514d\u5730 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[126],"tags":[70],"class_list":["post-359","post","type-post","status-publish","format-standard","hentry","category-java-microservices","tag-springcloud"],"_links":{"self":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts\/359","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=359"}],"version-history":[{"count":1,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts\/359\/revisions"}],"predecessor-version":[{"id":2113,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=\/wp\/v2\/posts\/359\/revisions\/2113"}],"wp:attachment":[{"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=359"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=359"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ttwow.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=359"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}