Skip to content

Commit

Permalink
Merge pull request dyc87112#8 from zkzong/master
Browse files Browse the repository at this point in the history
修改eureka-consumer-feign-hystrix,实现hystrix功能
  • Loading branch information
程序猿DD-翟永超 authored Sep 15, 2017
2 parents c552759 + 0317503 commit 345bf1d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-feign</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-hystrix</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* @create 2017/6/24.
* @blog http://blog.didispace.com
*/
@FeignClient("eureka-client")
@FeignClient(name = "eureka-client", fallback = DcClientFallback.class)
public interface DcClient {

@GetMapping("/dc")
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package com.didispace;

import org.springframework.stereotype.Component;

/**
* @author 翟永超
* @create 2017/6/24.
* @blog http://blog.didispace.com
*/
@Component
public class DcClientFallback implements DcClient {

@Override
public String consumer() {
return "fallback";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ server.port=2101

eureka.client.serviceUrl.defaultZone=http://localhost:1001/eureka/

feign.hystrix.enabled=true

logging.file=${spring.application.name}.log

0 comments on commit 345bf1d

Please sign in to comment.