如何解决FeignClient超时问题

编程入门 行业动态 更新时间:2024-10-28 21:18:24
本文介绍了如何解决FeignClient超时问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

使用使用FeignClient在SQL Server中执行查询的服务时,我的应用程序出现以下错误.

My application is getting below error when consuming a service that performs queries in SQL Server using FeignClient.

错误:

线程"pool-10-thread-14" feign.RetryableException中的异常:执行GET读取超时 127.0.0.1:8876/processoData/search/buscaProcessoPorCliente?cliente = ELEKTRO +-+ TRABALHISTA& estado = SP

Exception in thread "pool-10-thread-14" feign.RetryableException: Read timed out executing GET 127.0.0.1:8876/processoData/search/buscaProcessoPorCliente?cliente=ELEKTRO+-+TRABALHISTA&estado=SP

我的消费者服务:

@FeignClient(url="127.0.0.1:8876") public interface ProcessoConsumer { @RequestMapping(method = RequestMethod.GET, value = "/processoData/search/buscaProcessoPorCliente?cliente={cliente}&estado={estado}") public PagedResources<ProcessoDTO> buscaProcessoClienteEstado(@PathVariable("cliente") String cliente, @PathVariable("estado") String estado); }

我的YML:

server: port: 8874 endpoints: restart: enabled: true shutdown: enabled: true health: sensitive: false eureka: client: serviceUrl: defaultZone: ${vcap.services.eureka-service.credentials.uri:xxx.xx.xxx.xx:8764}/eureka/ instance: preferIpAddress: true ribbon: eureka: enabled: true spring: application: name: MyApplication data: mongodb: host: xxx.xx.xxx.xx port: 27017 uri: mongodb://xxx.xx.xxx.xx/recortesExtrator repositories.enabled: true solr: host: xxx.xx.xxx.xx:8983/solr repositories.enabled: true

有人知道如何解决这个问题吗?

Anyone know how to solve this?

谢谢.

推荐答案

在Application.properties文件中添加以下属性.

Add below properties in Application.properties file.

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

更多推荐

如何解决FeignClient超时问题

本文发布于:2023-07-16 03:42:21,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1117462.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:如何解决   FeignClient

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!