azure-blob-storageazure-sdkazure-sdk-for-java

What is the difference between RetryOptions and RequestRetryOptions?


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?


Solution

  • SpecializedBlobClientBuilder class provides options for configuring retries when interacting with Azure Blob Storage using Java.

    1. SpecializedBlobClientBuilder retryOptions(RequestRetryOptions retryOptions):

    As mentioned in the MSDOC, RequestRetryOptions class allows to configure options specifically related to retrying individual HTTP requests made by SDK client.

    enter image description here

    1. SpecializedBlobClientBuilder retryOptions(RetryOptions retryOptions)

    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

    enter image description here


    References:

    Refer to the github repo for sample code to understand SpecializedBlobClientBuilder, RetryOptions and RequestRetryOptions.