Start a new topic

Can I change the default timeout for the Java client requests?

Is there a way I can set the timeout for the Java client API requests in ChargeBee overriding the default value?

1 Comment

Yes. By default, the connection timeout period is 15000 milliseconds and the read timeout is 60000 milliseconds.

You can override the default connection and read timeouts as shown below:

  Environment.defaultConfig().connectTimeout = 50000;
  Environment.defaultConfig().readTimeout = 80000;

You can specify your own values instead of 50000 and 80000. It will overwrite the default HttpURLConnection's connect and read timeout. You can checkout the respective code in HttpUtil.java in the Java client library.



Login or Signup to post a comment