2
  @Bean
    public ApacheHttpClient client() {
        RequestConfig config = RequestConfig.custom().setConnectTimeout(30)
                .setSocketTimeout(30).build();

        CloseableHttpClient httpClientObject = HttpClientBuilder.create()
                .setDefaultRequestConfig(config)
                .build();
        return new ApacheHttpClient(httpClientObject);
    }


@Autowired
    public HTTPRequestClient(Decoder decoder, Encoder encoder, ApacheHttpClient client) {
        this.client = client;

        setHttpRequestAdaptor(Feign.builder()
                .client(client)
                .encoder(encoder)
                .decoder(decoder)
                .logLevel(feign.Logger.Level.FULL)
                .target(Target.EmptyTarget.create(HTTPRequestAdaptor.class)));

    }

Connection timeout and socket time out is not working. Help required what properties work with feign http client? I have been using

feign.httpclient.enabled=true
feign.httpclient.connection-timeout=2

but it didn't worked.

Reema Joshi
  • 133
  • 2
  • 9

1 Answers1

0

You can add a .options(new Request.Options(30, 30)) to the feign builder

If that fails then maybe add the entire class to the quesion. The this.client = client part of code looks a bit odd .

JoeyHolloway
  • 458
  • 7
  • 19