Closed pintomau closed 1 year ago
The Apache Client module creates a client instance with it's default parameters. I took a look and it seems it's 3 minutes for response and connect timeouts.
To manually configure them you can directly instanciate the Client instance and configure it according to the Apache HTTP client docs:
ApiRootBuilder.of(new CtApacheHttpClient(
64,
64,
builder -> builder
.setIOReactorConfig(IOReactorConfig.custom() // e.g. set the socket timeout
.setSoTimeout(10, TimeUnit.SECONDS)
.build())
.setDefaultRequestConfig(RequestConfig.custom() // or configure the request parameters
.setResponseTimeout(10, TimeUnit.SECONDS)
.setConnectTimeout(3, TimeUnit.SECONDS)
.build())
));
Btw we decided to set some values in the other clients to avoid having connections and responses without any timeout set.
Thanks for the confirmation, Jens.
Hi.
In other clients I do see some explicit 120 seconds to connect, read, write timeout.
Wondering if for the Apache client we're defaulting to
org.apache.hc.client5.http.config.RequestConfig#DEFAULT
or something else?And what would be CT's recommended way to set default request configuration timeouts?
Say, something like this?
Or would the Queuing middleware be the way to go as explained in https://commercetools.github.io/commercetools-sdk-java-v2/javadoc/com/commercetools/docs/meta/ClientTuning.html ?
Thanks.