{"id":2986,"date":"2018-08-14T09:29:40","date_gmt":"2018-08-14T01:29:40","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=2986"},"modified":"2018-08-14T09:29:40","modified_gmt":"2018-08-14T01:29:40","slug":"spring-cloud-%e6%95%99%e7%a8%8b%e7%ac%ac%e5%8d%81%e4%b8%80%e7%ab%a0-turbine-%e5%af%b9-hystrix-%e7%9a%84%e9%9b%86%e7%be%a4%e7%9b%91%e6%8e%a7","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=2986","title":{"rendered":"Spring Cloud \u6559\u7a0b\u7b2c\u5341\u4e00\u7ae0 turbine \u5bf9 Hystrix \u7684\u96c6\u7fa4\u76d1\u63a7"},"content":{"rendered":"<p>\n\t\u4e0a\u4e00\u7ae0\u6211\u4eec\u505a\u4e86&nbsp;Hystrix&nbsp;\u7684\u76d1\u63a7\uff0c\u4f7f\u7528\u4e86 Hystrix Dashboard\uff08\u63a7\u5236\u53f0\uff09\u3002Hystrix Dashboard \u7684\u7f3a\u70b9\u662f\u53ea\u80fd\u76d1\u63a7\u4e00\u4e2a\u670d\u52a1\uff0c\u5728\u5b9e\u9645\u751f\u4ea7\u4e00\u4e2a\u4e00\u4e2a\u7684\u76d1\u63a7\u592a\u9ebb\u70e6\u4e86\uff0c\u4e5f\u592a\u590d\u6742\u4e86\uff0c\u7ed9\u8fd0\u7ef4\u5e26\u6765\u7684\u662f\u707e\u96be\u3002\u4e8e\u662f\u6211\u4eec\u5c31\u9700\u8981\u4e00\u79cd\u5bf9\u6240\u6709\u670d\u52a1\u7684\u7194\u65ad\u90fd\u80fd\u76d1\u63a7\u7684\u7ec4\u4ef6&nbsp;Turbine\u3002\u672c\u6587\u5c06\u5177\u4f53\u7684\u4ecb\u7ecd\u5982\u4f55\u4f7f\u7528&nbsp;Turbine \u5bf9\u6240\u6709\u7684\u670d\u52a1\u7684\u65ad\u8def\u72b6\u6001\u8fdb\u884c\u76d1\u63a7\u3002\n<\/p>\n<p>\n\tTurbine \u662f Netflix \u63d0\u4f9b\u7684\u4e00\u4e2a\u5f00\u6e90\u9879\u76ee\uff0c\u6765\u63d0\u4f9b\u628a\u591a\u4e2a hystrix.stream \u7684\u5185\u5bb9\u805a\u5408\u4e3a\u4e00\u4e2a\u6570\u636e\u6e90\u4f9b Dashboard \u5c55\u793a\u3002\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u6211\u5728\u7f51\u4e0a\u627e\u5230\u4e86\u4e00\u4e2a&nbsp;Hystrix Dashboard\uff08\u63a7\u5236\u53f0\uff09\u5404\u9879\u6570\u5b57\u7684\u542b\u4e49\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"Dashboard \u53c2\u6570\u8be6\u89e3\" src=\"http:\/\/ocuzluml6.bkt.clouddn.com\/springcloud02.png\" style=\"width: 690px;height: 464px\" \/>\n<\/p>\n<p>\n\t\u4e0b\u9762\u6211\u4eec\u5f00\u59cb\u672c\u6587\u7684\u5185\u5bb9\uff0c\u540c\u6837\u7684\u6211\u4eec\u5148\u65b0\u5efa\u4e00\u4e2a\u5de5\u7a0b\uff1axttblog-hystrix-turbine\u3002pom.xml \u6587\u4ef6\u53ea\u6bd4&nbsp;<a href=\"https:\/\/github.com\/xmt1139057136\/xttblog-cloud\/tree\/master\/xttblog-hystrix-dashboard\" id=\"fd788b0160c8e841c8306fb089e6025c-494a0561ebe7f1441fa41ed25ac985309395ada3\" title=\"xttblog-hystrix-dashboard\">xttblog-hystrix-dashboard<\/a>&nbsp;\u591a\u4e86\u4e24\u4e2a starter\u3002\n<\/p>\n<pre>\r\n&lt;dependency&gt;\r\n    &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;spring-cloud-starter-turbine&lt;\/artifactId&gt;\r\n&lt;\/dependency&gt;\r\n\r\n&lt;dependency&gt;\r\n    &lt;groupId&gt;org.springframework.cloud&lt;\/groupId&gt;\r\n    &lt;artifactId&gt;spring-cloud-netflix-turbine&lt;\/artifactId&gt;\r\n&lt;\/dependency&gt;<\/pre>\n<p>\n\t\u7136\u540e\u662f\u914d\u7f6e yml \u6587\u4ef6\uff1a\n<\/p>\n<pre class=\"brush:plain;\">\r\nserver:\r\n  port: 8999\r\n\r\neureka:\r\n  instance:\r\n    hostname: localhost\r\n  client:\r\n    serviceUrl:\r\n      defaultZone: http:\/\/${eureka.instance.hostname}:8761\/eureka\/\r\n\r\nspring:\r\n  application:\r\n    name: xttblog-hystrix-turbine\r\n\r\n#feign:\r\n#  hystrix:\r\n#    enabled: true\r\n\r\nturbine:\r\n  aggregator:\r\n    # \u6307\u5b9a\u805a\u5408\u54ea\u4e9b\u96c6\u7fa4\uff0c\u591a\u4e2a\u4f7f\u7528&quot;,&quot;\u5206\u5272\uff0c\u9ed8\u8ba4\u4e3adefault\u3002\u53ef\u4f7f\u7528http:\/\/...\/turbine.stream?cluster={clusterConfig\u4e4b\u4e00}\u8bbf\u95ee\r\n    cluster-config: default\r\n  cluster-name-expression: &quot;&#039;default&#039;&quot;\r\n  app-config: xttblog-hystrix-dashboard,xttblog-ribbon-hystrix\r\n  # 1. clusterNameExpression\u6307\u5b9a\u96c6\u7fa4\u540d\u79f0\uff0c\u9ed8\u8ba4\u8868\u8fbe\u5f0fappName\uff1b\u6b64\u65f6\uff1aturbine.aggregator.clusterConfig\u9700\u8981\u914d\u7f6e\u60f3\u8981\u76d1\u63a7\u7684\u5e94\u7528\u540d\u79f0\r\n  # 2. \u5f53clusterNameExpression: default\u65f6\uff0cturbine.aggregator.clusterConfig\u53ef\u4ee5\u4e0d\u5199\uff0c\u56e0\u4e3a\u9ed8\u8ba4\u5c31\u662fdefault\r\n  # 3. \u5f53clusterNameExpression: metadata['cluster']\u65f6\uff0c\u5047\u8bbe\u60f3\u8981\u76d1\u63a7\u7684\u5e94\u7528\u914d\u7f6e\u4e86eureka.instance.metadata-map.cluster: ABC\uff0c\u5219\u9700\u8981\u914d\u7f6e\uff0c\u540c\u65f6turbine.aggregator.clusterConfig: ABC<\/pre>\n<p>\n\t\u542f\u52a8\u7c7b\u4e0a\uff0c\u9700\u8981\u914d\u7f6e\u4e0a&nbsp;@EnableHystrixDashboard \u548c @EnableTurbine \u6ce8\u89e3\u3002\n<\/p>\n<pre class=\"brush:java;\">\r\n@SpringBootApplication\r\n@EnableDiscoveryClient\r\n@EnableHystrixDashboard\r\n\/\/@EnableTurbineStream\r\n@EnableTurbine\r\npublic class HystrixTurbineApplication {\r\n    public static void main(String[] args) {\r\n        SpringApplication.run(HystrixTurbineApplication.class, args);\r\n    }\r\n}<\/pre>\n<p>\n\t\u6700\u540e\u6211\u4eec\u4f9d\u6b21\u542f\u52a8&nbsp;<a href=\"https:\/\/github.com\/xmt1139057136\/xttblog-cloud\/tree\/master\/xttblog-eureka-server\" id=\"610404df11f1f774ab9dbccd98e28057-08c9977570b3053cfe346ff915969042bc55f9de\" title=\"xttblog-eureka-server\">xttblog-eureka-server<\/a>\u3001<a href=\"https:\/\/github.com\/xmt1139057136\/xttblog-cloud\/tree\/master\/xttblog-cloud-producer\" id=\"9424eddbc95871ee7c06d2fa4c8d2262-bdfb15f3dfbb9b8700a93fe59c2f5bf802259038\" title=\"xttblog-cloud-producer\">xttblog-cloud-producer<\/a>\u3001<a href=\"https:\/\/github.com\/xmt1139057136\/xttblog-cloud\/tree\/master\/xttblog-feign-hystrix\" id=\"373f140013f1a9f7d211ce5e80b6d041-63b7a7088ad154629da37826c04dc0502e148f10\" title=\"xttblog-feign-hystrix\">xttblog-feign-hystrix<\/a>\u3001<a href=\"https:\/\/github.com\/xmt1139057136\/xttblog-cloud\/tree\/master\/xttblog-hystrix-turbine\" id=\"ec58489f4adff47168130835e31a8ecd-d163a7ba6420065b1462342244543388e1cc38a9\" title=\"xttblog-hystrix-turbine\">xttblog-hystrix-turbine<\/a>\u3002\u7136\u540e\u5404\u4e2a\u670d\u52a1\u90fd\u4f9d\u6b21\u8bbf\u95ee\u4e00\u4e0b\uff0c\u80fd\u6b63\u5e38\u8bbf\u95ee\u8bf4\u660e\u6ca1\u95ee\u9898\u3002\u6700\u540e\uff0c\u6211\u4eec\u5728\u628a&nbsp;<a href=\"https:\/\/github.com\/xmt1139057136\/xttblog-cloud\/tree\/master\/xttblog-cloud-producer\" id=\"9424eddbc95871ee7c06d2fa4c8d2262-bdfb15f3dfbb9b8700a93fe59c2f5bf802259038\" title=\"xttblog-cloud-producer\">xttblog-cloud-producer<\/a>&nbsp;\u7ed9\u5173\u95ed\uff0c\u518d\u8bbf\u95ee&nbsp;<a href=\"https:\/\/github.com\/xmt1139057136\/xttblog-cloud\/tree\/master\/xttblog-feign-hystrix\" id=\"373f140013f1a9f7d211ce5e80b6d041-63b7a7088ad154629da37826c04dc0502e148f10\" title=\"xttblog-feign-hystrix\">xttblog-feign-hystrix<\/a>\uff08http:\/\/localhost:8999\/turbine.stream\uff09&nbsp;\u76f8\u5f53\u4e8e\u662f\u53d1\u751f\u7194\u65ad\u3002\u5c31\u80fd\u5728&nbsp;<a href=\"https:\/\/github.com\/xmt1139057136\/xttblog-cloud\/tree\/master\/xttblog-hystrix-turbine\" id=\"ec58489f4adff47168130835e31a8ecd-d163a7ba6420065b1462342244543388e1cc38a9\" title=\"xttblog-hystrix-turbine\">xttblog-hystrix-turbine<\/a>&nbsp;\u4e2d\u770b\u5230\u6548\u679c\u3002\n<\/p>\n<p>\n\tTurbine \u7684\u6574\u4f53\u754c\u9762\u770b\u8d77\u6765\u592a\u4e11\u4e86\uff0c\u4e0d\u7b26\u5408\u56fd\u4eba\u7684\u5ba1\u7f8e\u89c2\u3002\u540e\u9762\u6709\u673a\u4f1a\u4e86\uff0c\u53ef\u4ee5\u7ed9\u5b83\u7684\u754c\u9762\u6362\u4e00\u5957\u6a21\u7248\uff0c\u505a\u7684\u7c7b\u4f3c\u963f\u91cc\u7684&nbsp;Sentinel \u63a7\u5236\u53f0\u7684\u4e00\u6837\u7684\u6548\u679c\u3002\n<\/p>\n<p>\n\tTurbine \u8fd8\u53ef\u4ee5\u548c&nbsp;rabbitmq \u8fdb\u884c\u6574\u5408\u3002\u5982\u679c\u9700\u8981\u6574\u5408&nbsp;rabbitmq \uff0c\u5c31\u9700\u8981\u5f00\u542f&nbsp;@EnableTurbineStream \u6ce8\u89e3\u3002\n<\/p>\n<p>\n\tTurbine \u53ea\u80fd\u76d1\u63a7 hystrix \u670d\u52a1\uff0c\u4e0d\u662f hystrix \u670d\u52a1\uff0c\u4e0d\u80fd\u76d1\u63a7\u3002\u67e5\u770b\u76d1\u63a7\u4fe1\u606f\u65f6\uff0c\u9700\u8981\u5148\u8bbf\u95ee\u4ee5\u4e0b hystrix \u670d\u52a1\u3002\u5982\u679c\u6709\u5176\u4ed6\u95ee\u9898\uff0c\u53ef\u4ee5\u7ed9\u6211\u7559\u8a00\u3002\u672c\u6587\u76f8\u5173\u6e90\u4ee3\u7801\u5df2\u4e0a\u4f20\u81f3\uff1a<a href=\"https:\/\/github.com\/xmt1139057136\/xttblog-cloud\" name=\"Spring Cloud \u6559\u7a0b\" target=\"_blank\" title=\"Spring Cloud \u6559\u7a0b\">https:\/\/github.com\/xmt1139057136\/xttblog-cloud<\/a>\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=2986\">Spring Cloud \u6559\u7a0b\u7b2c\u5341\u4e00\u7ae0 turbine \u5bf9 Hystrix \u7684\u96c6\u7fa4\u76d1\u63a7<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u4e0a\u4e00\u7ae0\u6211\u4eec\u505a\u4e86&nbsp;Hystrix&nbsp;\u7684\u76d1\u63a7\uff0c\u4f7f\u7528\u4e86 Hystrix Dashboard\uff08\u63a7\u5236\u53f0 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[479,1661,587,588,1662],"class_list":["post-2986","post","type-post","status-publish","format-standard","hentry","category-java","tag-dubbo","tag-hystrix","tag-spring-boot","tag-spring-cloud","tag-turbine"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2986","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2986"}],"version-history":[{"count":2,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2986\/revisions"}],"predecessor-version":[{"id":2989,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/2986\/revisions\/2989"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2986"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2986"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2986"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}