2017-09-26 16 views
0

작동하지 나는이 FeignClient 아래에 있습니다척하기 Hystrix 대체

@FeignClient(name="FooMS",fallback=CustomerFeign.CustomerFeignImpl.class) 
public interface CustomerFeign { 

    @RequestMapping(value="/bar/{phoneNo}") 
    List<Long> getFriends(@PathVariable("phoneNo") Long phoneNo); 


    class CustomerFeignImpl implements CustomerFeign{ 

     @Override 
     public List<Long> getFriends(Long phoneNo) { 
      return new ArrayList<Long>(108); 
     } 

    } 

} 

FooMS 인스턴스가 다운 때, 나는 실행되는 500 오류 대신 대체를 얻을. 왜 이런 일이 일어나는 걸까요?

+0

스택 추적을 공유 할 수 있습니까? – jmhostalet

답변

1

CustomerFeignImpl@Component으로 태그하거나 그 중 @Bean을 작성하십시오.

+0

감사합니다. 또한 feign.hystrix.enabled = true 속성을 추가해야했습니다. 속성 파일을 통해 hystrix 시간 초과를 수정할 수 없다는 것을 발견했습니다. hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds = 50000 또는 hystrix.command.getFriends.execution.isolation.thread.timeoutInMilliseconds = 50000이라고해도, Feyst가있는 hystrix는 여전히 1 초 안에 타임 아웃합니다. 어떻게하면이 문제를 해결할 수 있을지 생각해? – codingsplash