Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Use RestTemplate send request to difference url, we want different request have different SocketTimeout parameter.
Currently RestTemplate doesn't have any interface costum timeout for pre request.
The HttpComponentsClientHttpRequestFactory can custum RequestConfig but when use with RestTemplate we have no chance to set timeout parameter.
No further details from SPR-17624
Brian Clozel commented
Configuring a per-request timeout is not something that's consistently supported in all clients and we tend to leave it to the native library. In this case, I believe you can use a specific configuration on Apache Http components to set that timeout on a per-host basis but you're right,
I don't see any way to support this feature for all supported clients.
As a workaround, you can either use the underlying library directly or switch to