SessionRetryOptionsBuilder Class
- java.
lang. Object - com.
azure. cosmos. SessionRetryOptionsBuilder
- com.
public final class SessionRetryOptionsBuilder
A SessionRetryOptionsBuilder instance will be used to build a SessionRetryOptions instance.
Constructor Summary
| Constructor | Description | |
|---|---|---|
| SessionRetryOptionsBuilder() | ||
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
Session |
build()
Builds an instance of SessionRetryOptions |
|
Session |
maxRetriesPerRegion(int maxRetriesPerRegion)
Sets the maximum number of retries within each region for read and write operations. |
|
Session |
minTimeoutPerRegion(Duration minTimeoutPerRegion)
Sets the minimum retry time for 404/1002 retries within each region for read and write operations. |
|
Session |
regionSwitchHint(CosmosRegionSwitchHint regionSwitchHint)
Sets the CosmosRegionSwitchHint which specifies for a request whether internal retry policies should prioritize a local region or a remote region. |
Methods inherited from java.lang.Object
Constructor Details
SessionRetryOptionsBuilder
public SessionRetryOptionsBuilder()
Method Details
build
public SessionRetryOptions build()
Builds an instance of SessionRetryOptions
Returns:
maxRetriesPerRegion
public SessionRetryOptionsBuilder maxRetriesPerRegion(int 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:
Returns:
minTimeoutPerRegion
public SessionRetryOptionsBuilder minTimeoutPerRegion(Duration 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:
Returns:
regionSwitchHint
public SessionRetryOptionsBuilder regionSwitchHint(CosmosRegionSwitchHint regionSwitchHint)
Sets the CosmosRegionSwitchHint which specifies for a request whether internal retry policies should prioritize a local region or a remote region.
NOTES:
nullvalues are not allowed
Parameters:
Returns: