ドキュメンテーションによると、Feign with Hystrixを使用すると、すべてのリクエストがHystrixコマンドにラップされます。SpringクラウドでHystrixPropertyをFeignリクエストに設定する方法は?
これらのコマンドにHystrix Propertiesを設定することはできますか?私はこのような何かをしたいと思います:
@RequestMapping(commandProperties = {
@HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "30000")})
List<Team> findAll();
かを:レコードの場合
@FeignClient(name = "teams", commandProperties = {
@HystrixProperty(name = "execution.isolation.thread.timeoutInMilliseconds", value = "30000")})
、私はすでにプロパティを使用しようとしたが、それはうまくいきませんでした。
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=10000
hystrix.command.findAll.execution.timeout.enabled=false
hystrix.command.default.execution.timeout.enabled=false
しかし、この1つはない:これらのものが働いている
//this property name is now misleading. //TODO figure out a good way to deprecate this property name
this.executionTimeoutInMilliseconds = getProperty(propertyPrefix, key, "execution.isolation.thread.timeoutInMilliseconds", builder.getExecutionIsolationThreadTimeoutInMilliseconds(), default_executionTimeoutInMilliseconds);
EDIT: I確か
hystrix.command.findAll.execution.isolation.thread.timeoutInMilliseconds=20000
、我々はHystrixCommandProperties
クラスに以下のコメントを読むことができますこれらのプロパティはhystrixに伝播していないようです。
設定しようとしているプロパティのベースは、リクエストタイムアウトに対処しようとしていると思いますが、スタックトレースはありますか?リボンは関与していますか? –
リモートサービスが応答するのに少し時間がかかるので、HystrixRuntimeException例外が発生します。 – Nicolas
あなたは 'application.properties'でプロパティを設定しましたか? –