Class SessionRetryOptionsBuilder

java.lang.Object
com.azure.cosmos.SessionRetryOptionsBuilder

public final class SessionRetryOptionsBuilder extends Object
A SessionRetryOptionsBuilder instance will be used to build a SessionRetryOptions instance.
  • Constructor Details

    • SessionRetryOptionsBuilder

      public SessionRetryOptionsBuilder()
  • Method Details

    • 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:

      • null values are not allowed
      Parameters:
      regionSwitchHint - The region switch hint
      Returns:
      This instance of SessionRetryOptionsBuilder
    • 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:
      minTimeoutPerRegion - the min retry time to be used with-in each region
      Returns:
      This instance of SessionRetryOptionsBuilder
    • 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:
      maxRetriesPerRegion - the max. number of retries with-in each region
      Returns:
      This instance of SessionRetryOptionsBuilder
    • build

      public SessionRetryOptions build()
      Builds an instance of SessionRetryOptions
      Returns:
      An instance of SessionRetryOptions