28

を使用して SQL Server でクエリを実行するサービスを使用すると、アプリケーションで以下のエラーが発生しますFeignClient

エラー:

スレッド「pool-10-thread-14」での例外 feign.RetryableException: GET の実行中に読み取りがタイムアウトしました http://127.0.0.1:8876/processoData/search/buscaProcessoPorCliente?cliente=ELEKTRO+-+TRABALHISTA&estado=SP

私の消費者サービス:

@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);

}

私の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

誰でもこれを解決する方法を知っていますか?

ありがとう。

4

7 に答える 7

10

Feign.builder()Feign クライアントをインスタンス化するために使用しています。

connectTimeoutとを設定するためにreadTimeout、次を使用します。

Feign.builder()
     ...
     .options(new Request.Options(connectTimeout, readTimeout))
     .target(MyApiInterface.class, url);

これを使用して、さまざまな API にさまざまなタイムアウトを設定できます。

于 2019-04-29T08:41:09.783 に答える