File tree Expand file tree Collapse file tree 4 files changed +24
-1
lines changed
2-Dalston版教程示例/eureka-consumer-feign-hystrix Expand file tree Collapse file tree 4 files changed +24
-1
lines changed Original file line number Diff line number Diff line change 3232 <groupId >org.springframework.cloud</groupId >
3333 <artifactId >spring-cloud-starter-feign</artifactId >
3434 </dependency >
35+ <dependency >
36+ <groupId >org.springframework.cloud</groupId >
37+ <artifactId >spring-cloud-starter-hystrix</artifactId >
38+ </dependency >
3539 <dependency >
3640 <groupId >org.springframework.boot</groupId >
3741 <artifactId >spring-boot-starter-web</artifactId >
Original file line number Diff line number Diff line change 88 * @create 2017/6/24.
99 * @blog http://blog.didispace.com
1010 */
11- @ FeignClient ("eureka-client" )
11+ @ FeignClient (name = "eureka-client" , fallback = DcClientFallback . class )
1212public interface DcClient {
1313
1414 @ GetMapping ("/dc" )
Original file line number Diff line number Diff line change 1+ package com .didispace ;
2+
3+ import org .springframework .stereotype .Component ;
4+
5+ /**
6+ * @author 翟永超
7+ * @create 2017/6/24.
8+ * @blog http://blog.didispace.com
9+ */
10+ @ Component
11+ public class DcClientFallback implements DcClient {
12+
13+ @ Override
14+ public String consumer () {
15+ return "fallback" ;
16+ }
17+ }
Original file line number Diff line number Diff line change @@ -3,4 +3,6 @@ server.port=2101
33
44eureka.client.serviceUrl.defaultZone =http://localhost:1001/eureka/
55
6+ feign.hystrix.enabled =true
7+
68logging.file =${spring.application.name}.log
You can’t perform that action at this time.
0 commit comments