I am working with the Azure SDK for Java and specifically with blob storage and I am using the SpecializedBlobClientBuilder
.
My question is around the various retry options:
SpecializedBlobClientBuilder retryOptions(RequestRetryOptions retryOptions)
SpecializedBlobClientBuilder retryOptions(RetryOptions retryOptions)
Initially I set RetryOptions
on my client, but it did not seem to take effect in the case of a network timeout. However when I set RequestRetryOptions
instead it does get applied and I am having trouble understanding why, what is the difference between these retry options and in which cases does RetryOptions
actually get applied?
SpecializedBlobClientBuilder
class provides options for configuring retries when interacting with Azure Blob Storage using Java.
As mentioned in the MSDOC, RequestRetryOptions
class allows to configure options specifically related to retrying individual HTTP requests made by SDK client.
It is used for scenarios like network timeouts, connection failures, and other issues encountered while sending a request.
If you set RequestRetryOptions
on your client, it will affect the retry behavior of every request made through that particular client.
As per MSDOC, this class is to configure retry policy for SDK client related to retrying higher-level operations and it handles retries at the operation level, which involve multiple HTTP requests
RetryOptions
on your client, it will affect the retry behavior for higher-level operations.RequestRetryOptions
class.RetryOptions
class.RequestRetryOptions
and RetryOptions
are mutually exclusive. So, it is better to consider both classes while configuring storage options.References:
Refer to the github repo for sample code to understand SpecializedBlobClientBuilder
, RetryOptions
and RequestRetryOptions
.