gpt4 book ai didi

spring-boot - feign.RetryableException : Read timed out executing GET

转载 作者:行者123 更新时间:2023-12-03 15:09:26 27 4
gpt4 key购买 nike

我的项目中有以下架构enter image description here

我的 UI 服务(端口 8080)对网关服务(端口 8085)进行了 Feign 调用。
我从 UI 服务的 Get 调用是“http://localhost:8080/invoice-list?startDate=2018-08-05&endDate=2018-10-05
来自网关服务“http://localhost:8085/invoice-download-service/invoice-list?startDate=2018-08-05&endDate=2018-10-05”的类似调用

当我从 UI 服务进行此 GET 调用时,我会在几分钟内收到以下错误

 is feign.RetryableException: Read timed out executing GET http://localhost:8085/invoice-download-service/invoice-list?startDate=2018-08-05&endDate=2018-10-05] with root cause

java.net.SocketTimeoutException: Read timed out

但是当我从网关服务器直接调用微服务时,我没有收到错误。

网关服务的Application.properties文件
hystrix.command.default.execution.isolation.thread.timeoutInMilliseconds=160000000

ribbon.OkToRetryOnAllOperations=true
ribbon.ReadTimeout=5000000
ribbon.ConnectTimeout=5000000
ribbon.MaxAutoRetries=3
ribbon.MaxAutoRetriesNextServer=3


zuul.host.socket-timeout-millis= 5000000
zuul.host.connect-timeout-millis= 5000000

在这里,我将 readtimeout 和 connecttimeout 属性设置为大约 8 到 10 分钟,因此我没有收到错误消息。

UI服务的Application.properties文件
spring.application.name=external-ui-service

server.port=8080

在 UI 服务中,我没有超时属性。我在这里尝试了上述属性但没有工作。
显然,这个 UI 服务没有使用ribbon、zuul 等。这只是对网关的 Feign 调用。

那么我应该怎么做才能增加 UI 服务的超时时间?

最佳答案

在 UI 服务 application.properties 文件中添加了以下属性。

feign.client.config.default.connectTimeout: 160000000
feign.client.config.default.readTimeout: 160000000

关于spring-boot - feign.RetryableException : Read timed out executing GET,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52664262/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com