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、hystrixとFeignは1秒でタイムアウトします。どのように私はこれを修正することができますどのような考え? – codingsplash

関連する問題