Rest Client for MicroProfile , connectTimeout vs readTimeout

106 Views Asked by At

In MicroProfile REST Client API (https://download.eclipse.org/microprofile/microprofile-rest-client-3.0-m1/microprofile-rest-client-spec-3.0-m1.html) there are two configurable timeouts:

com.mycompany.remoteServices.MyServiceClient/mp-rest/connectTimeout: Timeout specified in milliseconds to wait to connect to the remote endpoint.

com.mycompany.remoteServices.MyServiceClient/mp-rest/readTimeout: Timeout specified in milliseconds to wait for a response from the remote endpoint.

Similar thing exists in Java Socket (https://www.baeldung.com/java-socket-connection-read-timeout)

I understand the difference and I assume the read timeout should be set to longer value. But is any proper ratio between them either by convention or from your experience. e.g. should read timeout be 10x or twice as connection timeout or any other ratio?

0

There are 0 best solutions below