Closed anjia0532 closed 7 years ago
Can you try to put this configuration ?
zuul:
host:
connect-timeout-millis: 5000
socket-timeout-millis: 10000
# See https://github.com/Netflix/Hystrix/wiki/Configuration
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 10000
Currently, this config is only for gateway. I think we should extend it to microservices
yes, this is my gateway\src\main\resources\config\application.yml
ribbon:
ReadTimeout: 60000
eureka:
enabled: true
zuul:
host:
connect-timeout-millis: 5000
socket-timeout-millis: 60000
# See https://github.com/Netflix/Hystrix/wiki/Configuration
hystrix:
command:
default:
execution:
timeout:
enabled: false
isolation:
strategy: THREAD
thread:
timeoutInMilliseconds: 60000
and it's not real time-out,because the since the second is successful,the first invoke must be failure.
I already have the same issue like you: 1st request failed with timeout, 2nd successful You have to put this configuration in your microservices, not only in gateway
ok,i'll have a try. thank you :)
Reason why first request on a proxied service takes longer and may timeout is because ribbon clients are lazy instantiated.
See https://github.com/spring-cloud/spring-cloud-netflix/issues/1334 for a workaround.
hey,
i currently running this configuration in JHipster Registry for overall configuration:
hystrix:
command:
default:
execution:
isolation:
thread:
timeoutInMilliseconds: 20000
ribbon:
MaxAutoRetries: 3
ReadTimeout: 5000
eureka:
enabled: true
which you then can override using specialized config files, as well as env vars etc.
with this, my feign clients do also retries. I hope this configs are still the right one, if nothing changed since last cloud releases
I'm closing this, as I'm pretty sure these configuration can be a solution.
@xetys : there are a lot of different configurations, but it depends on business case
Yes I know. I added my to show the ribbon configuration, which was missing in the examples before
when the first time app1 invoked the app2 thow time-out exception,but since the second is successful.
App2FeignClient
AuthorizedFeignClient
Welcome to the JHipster Information Sub-Generator
JHipster Version(s)
JHipster configuration, a
.yo-rc.json
file generated in the root folderEntity configuration(s)
entityName.json
files generated in the.jhipster
directoryAppointment.json
Browsers and Operating System
java version "1.8.0_112" Java(TM) SE Runtime Environment (build 1.8.0_112-b15) Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)
git version 2.10.1.windows.1
node: v7.2.1
npm: 3.10.10
bower: 1.8.0
gulp: [11:08:41] CLI version 1.2.2
yeoman: 1.8.5
Docker version 1.12.2-rc1, build 45bed2c, experimental
docker-compose version 1.8.1, build 004ddae