Allow to configure HttpClient used in ConsulClient
See original GitHub issueIt would be nice to introduce some kind of configurer or configuration properties which will allow to configure Apache HttpClient used in consul-api.
PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(registry);
connectionManager.setMaxTotal(DEFAULT_MAX_CONNECTIONS);
connectionManager.setDefaultMaxPerRoute(DEFAULT_MAX_PER_ROUTE_CONNECTIONS);
RequestConfig requestConfig = RequestConfig.custom().
setConnectTimeout(DEFAULT_CONNECTION_TIMEOUT).
setConnectionRequestTimeout(DEFAULT_CONNECTION_TIMEOUT).
setSocketTimeout(DEFAULT_READ_TIMEOUT).
build();
HttpClientBuilder httpClientBuilder = HttpClientBuilder.create().
setConnectionManager(connectionManager).
setDefaultRequestConfig(requestConfig);
this.httpClient = httpClientBuilder.build();
Above you can find a code snippet from DefaultHttpsTransport, the same you can find in DefaultHttpTransport. It would be nice to be able to configure timeouts and connection limits (maxTotal, maxPerRoute).
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Discovering Services - Steeltoe Documentation
The recommended approach for discovering services is to use HttpClient supplied through HttpClientFactory, augmented with the DiscoveryHttpMessageHandler ...
Read more >Consul API client - Go Packages
NewHttpClient returns an http client configured with the given Transport and TLS config. func SetupTLSConfig ¶. func SetupTLSConfig(tlsConfig *TLSConfig) (*tls.
Read more >Configuration Reference - Micronaut Documentation
Whether or not the configuration client should use Instance Principal ... consul.client.exception-on-error-status ... Http Client Core Config Properties.
Read more >Service Discovery Using Consul And ASP.NET Core
The AddConsul method adds the Consul Client and its options to the service collection, along with a custom HTTP client that will be...
Read more >Agents - Configuration File Reference | Consul
Use agent configuration files to assign attributes to agents and ... config_entries This object allows setting options for centralized config entries.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

yes, once you have
spring-cloud-starter-consul-configthe consul client is created in bootstrap and auto configure before won’t work. You’d have to setup a bootstrap configuration@spencergibb Introducing bootstrap configuration helped. Thank you a lot! 😃