You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/storage/blobs/storage-retry-policy-java.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,30 +6,30 @@ author: pauljewellmsft
6
6
ms.author: pauljewell
7
7
ms.service: azure-blob-storage
8
8
ms.topic: how-to
9
-
ms.date: 05/01/2024
9
+
ms.date: 04/29/2024
10
10
ms.custom: devx-track-java, devguide-java
11
11
---
12
12
13
13
# Implement a retry policy with Java
14
14
15
15
Any application that runs in the cloud or communicates with remote services and resources must be able to handle transient faults. It's common for these applications to experience faults due to a momentary loss of network connectivity, a request timeout when a service or resource is busy, or other factors. Developers should build applications to handle transient faults transparently to improve stability and resiliency.
16
16
17
-
This article shows you how to use the Azure Storage client library for Java to configure a retry policy for an application that connects to Azure Blob Storage. Retry policies define how the application handles failed requests, and should always be tuned to match the business requirements of the application and the nature of the failure.
17
+
In this article, you learn how to use the Azure Storage client library for Java to configure a retry policy for an application that connects to Azure Blob Storage. Retry policies define how the application handles failed requests, and should always be tuned to match the business requirements of the application and the nature of the failure.
18
18
19
19
## Configure retry options
20
20
21
21
Retry policies for Blob Storage are configured programmatically, offering control over how retry options are applied to various service requests and scenarios. For example, a web app issuing requests based on user interaction might implement a policy with fewer retries and shorter delays to increase responsiveness and notify the user when an error occurs. Alternatively, an app or component running batch requests in the background might increase the number of retries and use an exponential backoff strategy to allow the request time to complete successfully.
22
22
23
-
The following table lists the properties of the [RequestRetryOptions](/java/api/com.azure.storage.common.policy.requestretryoptions)class, along with the type, a brief description, and the default value if you make no changes. You should be proactive in tuning the values of these properties to meet the needs of your app.
23
+
The following table lists the parameters available when constructing a [RequestRetryOptions](/java/api/com.azure.storage.common.policy.requestretryoptions)instance, along with the type, a brief description, and the default value if you make no changes. You should be proactive in tuning the values of these properties to meet the needs of your app.
24
24
25
25
| Property | Type | Description | Default value |
26
26
| --- | --- | --- | --- |
27
27
|`retryPolicyType`|[RetryPolicyType](/java/api/com.azure.storage.common.policy.retrypolicytype)| Optional. The approach to use for calculating retry delays. |[EXPONENTIAL](/java/api/com.azure.storage.common.policy.retrypolicytype#com-azure-storage-common-policy-retrypolicytype-exponential)|
28
28
|`maxTries`| Integer | Optional. The maximum number of retry attempts before giving up. | 4 |
29
-
|`tryTimeoutInSeconds`| Integer | Optional. Maximum time allowed before a request is cancelled and assumed failed. This value should be based on the bandwidth available to the host machine and proximity to the Storage service. A good starting point might be 60 seconds per MB of anticipated payload size. | Integer.MAX_VALUE seconds |
29
+
|`tryTimeoutInSeconds`| Integer | Optional. Maximum time allowed before a request is cancelled and assumed failed. This value should be based on the bandwidth available to the host machine and proximity to the Storage service. A good starting point might be 60 seconds per MB of anticipated payload size. | Integer.MAX_VALUE seconds.|
30
30
|`retryDelayInMs`| Long | Optional. Specifies the amount of delay to use before retrying an operation. | 4ms for EXPONENTIAL, 30ms for FIXED |
31
31
|`maxRetryDelayInMs`| Long | Optional. Specifies the maximum delay allowed before retrying an operation. | 120ms |
32
-
|`secondaryHost`| String | Optional. Secondary storage account endpoint to retry requests against. Before setting this value, you should understand the issues around reading stale and potentially inconsistent data. To learn more, see [Use geo-redundancy to design highly available applications](../common/geo-redundant-design.md)| None.|
32
+
|`secondaryHost`| String | Optional. Secondary storage account endpoint to retry requests against. Before setting this value, you should understand the issues around reading stale and potentially inconsistent data. To learn more, see [Use geo-redundancy to design highly available applications](../common/geo-redundant-design.md)| None |
33
33
34
34
In the following code example, we configure the retry options in an instance of [RequestRetryOptions](/java/api/com.azure.storage.common.policy.requestretryoptions) and pass it to `BlobServiceClientBuilder` to create a client object:
0 commit comments