#alexanderg - network retries
1 messages · Page 1 of 1 (latest)
hey there, that's not offered by the clients. To achieve this you'd implement it yourself using idempotency keys and track the attempts/errors.
So this setting affects all Stripe API calls?
For that instance of the client, yes
public static final int DEFAULT_CONNECT_TIMEOUT = 30 * 1000;
public static final int DEFAULT_READ_TIMEOUT = 80 * 1000;
If effectively applies idempotency keys internally
The default is 80 seconds?
From what you've quoted that appears to be the case. What are you trying to do?
Just looking to see if this needs to be adjusted in our case, 80 sec looks like a rather long call
Connect is to just establish connection to Stripe and read is for the full call execution on Stripe side?
The 80s is specific to read requests and you can override if if you prefer:
https://github.com/stripe/stripe-java/blob/master/src/main/java/com/stripe/Stripe.java#L110-L133
So default for read is 80 seconds.
Is there a way to set timeout for write calls? What is the default?
We set the number of retries (which I assume applies to the write calls as well), are the above timeouts above applicable to these retries?
Yes, the same timeout would apply to each retry. The code looks like the same timeout is used for all requests.
Though on second look it does appear that the request options allow you to override this per request: https://github.com/stripe/stripe-java/blob/master/src/main/java/com/stripe/net/RequestOptions.java#L124
Including retries: https://github.com/stripe/stripe-java/blob/master/src/main/java/com/stripe/net/RequestOptions.java#L225
So hopefully that helps with your original question
Nice!
Yes, the timeout would be per network request, not combined for all retries