Package com.azure.cosmos
Class SessionRetryOptionsBuilder
java.lang.Object
com.azure.cosmos.SessionRetryOptionsBuilder
A
SessionRetryOptionsBuilder
instance will be used to build
a SessionRetryOptions
instance.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds an instance ofSessionRetryOptions
maxRetriesPerRegion
(int maxRetriesPerRegion) Sets the maximum number of retries within each region for read and write operations.minTimeoutPerRegion
(Duration minTimeoutPerRegion) Sets the minimum retry time for 404/1002 retries within each region for read and write operations.regionSwitchHint
(CosmosRegionSwitchHint regionSwitchHint) Sets theCosmosRegionSwitchHint
which specifies for a request whether internal retry policies should prioritize a local region or a remote region.
-
Constructor Details
-
SessionRetryOptionsBuilder
public SessionRetryOptionsBuilder()
-
-
Method Details
-
regionSwitchHint
Sets theCosmosRegionSwitchHint
which specifies for a request whether internal retry policies should prioritize a local region or a remote region.NOTES:
null
values are not allowed
- Parameters:
regionSwitchHint
- The region switch hint- Returns:
- This instance of
SessionRetryOptionsBuilder
-
minTimeoutPerRegion
Sets the minimum retry time for 404/1002 retries within each region for read and write operations. The minimum value is 100ms - this minimum is enforced to provide a way for the local region to catch-up on replication lag. The default value is 500ms - as a recommendation ensure that this value is higher than the steady-state replication latency between the regions you chose.- Parameters:
minTimeoutPerRegion
- the min retry time to be used with-in each region- Returns:
- This instance of
SessionRetryOptionsBuilder
-
maxRetriesPerRegion
Sets the maximum number of retries within each region for read and write operations. The minimum value is 1 - the backoff time for the last in-region retry will ensure that the total retry time within the region is at least the min. in-region retry time.- Parameters:
maxRetriesPerRegion
- the max. number of retries with-in each region- Returns:
- This instance of
SessionRetryOptionsBuilder
-
build
Builds an instance ofSessionRetryOptions
- Returns:
- An instance of
SessionRetryOptions
-