Commit 4d33d54a by yong.huang

update feign code

parent 77cd8dc3
...@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam; ...@@ -13,7 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
* @Date: 2018/11/20 10:04 * @Date: 2018/11/20 10:04
* @Description: * @Description:
*/ */
@FeignClient(name = "dictionary", path = "/dict") @FeignClient(name = "dictionary", path = "/dict", fallback = IDictFeignServiceFallback.class)
public interface IDictFeignService { public interface IDictFeignService {
@GetMapping(value = "/dictDatas/{dictTypeCd}") @GetMapping(value = "/dictDatas/{dictTypeCd}")
...@@ -22,3 +22,18 @@ public interface IDictFeignService { ...@@ -22,3 +22,18 @@ public interface IDictFeignService {
@GetMapping(value = "/dictData/{dictTypeCd}/{dictCd}") @GetMapping(value = "/dictData/{dictTypeCd}/{dictCd}")
ResDto<DictDataDto> dictData(@RequestParam("dictTypeCd") String dictTypeCd , @RequestParam("dictCd") String dictCd); ResDto<DictDataDto> dictData(@RequestParam("dictTypeCd") String dictTypeCd , @RequestParam("dictCd") String dictCd);
} }
@Component
class IDictFeignServiceFallback implements IDictFeignService{
@Override
public ResDto dictDatas(String dictTypeCd) {
return new ResDto();
}
@Override
public ResDto<DictDataDto> dictData(String dictTypeCd, String dictCd) {
DictDataDto dictDataDto = new DictDataDto();
return new ResDto<>(dictDataDto);
}
}
...@@ -20,6 +20,13 @@ eureka: ...@@ -20,6 +20,13 @@ eureka:
serviceUrl: serviceUrl:
defaultZone: http://localhost:8761/eureka/ defaultZone: http://localhost:8761/eureka/
feign:
hystrix:
enabled: true
hystrix:
threadpool:
default:
coreSize: 100 #并发执行的最大线程数,默认10
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment