Good morning,
I am using Hyxtrix to implement the Circuit Breaker design pattern. I would like to know how to pass the value using a variable or reading from Config Server
@HystrixCommand(
commandProperties = {
@HystrixProperty(
name="execution.isolation.thread.timeoutInMilliseconds",
value="500")
})
Idea 1:
@Value("${system1.timeout}")
String system1Timeout;
@HystrixCommand(
commandProperties = {
@HystrixProperty(
name="execution.isolation.thread.timeoutInMilliseconds",
value="system1Timeout")
})
This idea doesn't work.
Idea 2:
@HystrixCommand(
commandProperties = {
@HystrixProperty(
name="execution.isolation.thread.timeoutInMilliseconds",
value="${system1.timeout}")
})
This idea doesn't work.
Many thanks in advance.
Juan Antonio
HystrixCommand is third party code. It will never work. You should be able to put those properties in application.yml.
Hi @spencergibb,
If I set the Hyxtrix configuration on application.yml, how to set different values for different Hyxtrix commands?
Juan Antonio
Hystrix properties cannot be dynamic. It's part of the philosophy of Hystrix. Myself was interested in having a dynamic timeout value depending on the content of my processing, but Hystrix does not permit this feature.
The idea of issue was, how to configure parameters of a HyxtrixCommand outside of the usage.
I found a way:
hystrix:
command:
beanMethodInteractingWithSystem1:
execution:
timeout:
enabled: true
isolation:
thread:
timeoutInMilliseconds: 20000
And what happens if i have two classes with the same name "
beanMethodInteractingWithSystem1" ??
Juan Antonio Breña Moral [email protected] schrieb am Fr., 22.
Juli 2016 um 12:59 Uhr:
The idea of issue was, how to configure parameters of a HyxtrixCommand
outside of the usage.I found a way:
hystrix:
command:
beanMethodInteractingWithSystem1:
execution:
timeout:
enabled: true
isolation:
thread:
timeoutInMilliseconds: 20000—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/spring-cloud/spring-cloud-netflix/issues/1209#issuecomment-234515827,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAYARl6wGy7MRXQ2XeCzJ8VUl1A-kLtbks5qYKJ0gaJpZM4JShx-
.
cforce [email protected] schrieb am Fr., 22. Juli 2016 um 15:05 Uhr:
And what happens if i have two classes with the same name "
beanMethodInteractingWithSystem1" ??Juan Antonio Breña Moral [email protected] schrieb am Fr., 22.
Juli 2016 um 12:59 Uhr:The idea of issue was, how to configure parameters of a HyxtrixCommand
outside of the usage.I found a way:
hystrix:
command:
beanMethodInteractingWithSystem1:
execution:
timeout:
enabled: true
isolation:
thread:
timeoutInMilliseconds: 20000—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/spring-cloud/spring-cloud-netflix/issues/1209#issuecomment-234515827,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAYARl6wGy7MRXQ2XeCzJ8VUl1A-kLtbks5qYKJ0gaJpZM4JShx-
.