Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to solve Timeout FeignClient

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

ERROR:

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

My Consumer Service:

@FeignClient(url="http://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);  } 

My YML:

server:   port: 8874  endpoints:   restart:     enabled: true   shutdown:     enabled: true   health:     sensitive: false  eureka:   client:   serviceUrl:     defaultZone: ${vcap.services.eureka-service.credentials.uri:http://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: http://xxx.xx.xxx.xx:8983/solr       repositories.enabled: true 

Anyone know how to solve this?

Thanks.

like image 638
Renan Lalier Avatar asked Jun 28 '16 15:06

Renan Lalier


1 Answers

Add the following properties into application.properties file, in milliseconds.

feign.client.config.default.connectTimeout=160000000 feign.client.config.default.readTimeout=160000000 
like image 88
chaitanya dalvi Avatar answered Sep 23 '22 11:09

chaitanya dalvi