on 07-18-2023 12:17 AM
Hi Team,
We are using this to send requests to a third party endpoint defined in Destinations in BTP
HttpDestination destination = DestinationAccessor.getDestination("my-destination").asHttp();<br>HttpClient client = HttpClientAccessor.getHttpClient(destination);<br>HttpResponse httpResponse = client.execute(httpPost);
Just wondering what the default values are for timeouts, connection pool etc. are???? We just need to make sure we have decent numbers for our production systems.
Planning to use DefaultHttpClientFactory if the defaults are not same :
- connection and connection request timeout - 5 s
- socket timeout - 30 s
- max connections - 200
- max connections per route - 20
HttpClientFactory factory = new DefaultHttpClientFactory();<br>HttpClient client = factory.createHttpClient(destination);
Appreciate any inputs on this.
marcbecker : any wisdom you can share here please?
🙂
Thanks
Dharmesh
Hi Dharmesh,
the API you are referring to belongs to the SAP Cloud SDK for Java.
As such, you can find guidance about the HTTP Client and related classes in our official documentation.
To also answer your question: By default, the `DefaultHttpClientFactory` uses the following configuration:
- Connection, Connection Request, and Socket timeout: 2 minutes
- Max total connections: 200
- Max connections per route: 100
You can easily customize these values to your needs by following the procedure in the linked documentation.
Please also note that the `HttpClientAccessor` already uses the `DefaultHttpClientFactory` (without any explicit arguments passed) under the hood; so both code snippets in your initial question will yield the same result in terms of configuration.
Hope that explanation helps
Best regards,
Johannes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
68 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.