com.hazelcast.client.config

## Class ConnectionRetryConfig

- java.lang.Object
- - com.hazelcast.client.config.ConnectionRetryConfig

-     public class ConnectionRetryConfig
      extends Object

  Connection Retry Config is controls the period among the retries and when should a client gave up retrying. Exponential behaviour can be chosen or jitter can be added to wait periods.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConnectionRetryConfig()`
    `ConnectionRetryConfig(ConnectionRetryConfig connectionRetryConfig)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `int` | `getInitialBackoffMillis()` how long to wait after the first failure before retrying
    `double` | `getJitter()` by how much to randomize backoffs.
    `int` | `getMaxBackoffMillis()` When backoff reaches this upper bound, it does not increase any more.
    `double` | `getMultiplier()` factor with which to multiply backoff after a failed retry
    `int` | `hashCode()`
    `boolean` | `isEnabled()` enables connection retry logic.
    `boolean` | `isFailOnMaxBackoff()` whether to fail when the max-backoff has reached or continue waiting max-backoff-millis at each iteration When on fail, client shuts down.
    `ConnectionRetryConfig` | `setEnabled(boolean enabled)` enables connection retry logic.
    `ConnectionRetryConfig` | `setFailOnMaxBackoff(boolean failOnMaxBackoff)`
    `ConnectionRetryConfig` | `setInitialBackoffMillis(int initialBackoffMillis)`
    `ConnectionRetryConfig` | `setJitter(double jitter)` At each iteration calculated back-off is randomized via following method Random(-jitter * current_backoff, jitter * current_backoff)
    `ConnectionRetryConfig` | `setMaxBackoffMillis(int maxBackoffMillis)` When backoff reaches this upper bound, it does not increase any more.
    `ConnectionRetryConfig` | `setMultiplier(double multiplier)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ConnectionRetryConfig

          public ConnectionRetryConfig()

    - #### ConnectionRetryConfig

          public ConnectionRetryConfig(ConnectionRetryConfig connectionRetryConfig)

  - ### Method Detail

    - #### getInitialBackoffMillis

          public int getInitialBackoffMillis()

      how long to wait after the first failure before retrying
      Returns:
        initialBackoffMillis

    - #### setInitialBackoffMillis

          public ConnectionRetryConfig setInitialBackoffMillis(int initialBackoffMillis)

      Parameters:
        `initialBackoffMillis` - how long to wait after the first failure before retrying
      Returns:
        updated ConnectionRetryConfig

    - #### getMaxBackoffMillis

          public int getMaxBackoffMillis()

      When backoff reaches this upper bound, it does not increase any more. Behaviour after that changes depending on `failOnMaxBackoff` option
      Returns:
        maxBackoffMillis

    - #### setMaxBackoffMillis

          public ConnectionRetryConfig setMaxBackoffMillis(int maxBackoffMillis)

      When backoff reaches this upper bound, it does not increase any more. Behaviour after that changes depending on `failOnMaxBackoff` option
      Parameters:
        `maxBackoffMillis` - upper bound on backoff
      Returns:
        updated ConnectionRetryConfig

    - #### getMultiplier

          public double getMultiplier()

      factor with which to multiply backoff after a failed retry
      Returns:
        multiplier

    - #### setMultiplier

          public ConnectionRetryConfig setMultiplier(double multiplier)

      Parameters:
        `multiplier` - factor with which to multiply backoff after a failed retry
      Returns:
        updated ConnectionRetryConfig

    - #### isFailOnMaxBackoff

          public boolean isFailOnMaxBackoff()

      whether to fail when the max-backoff has reached or continue waiting max-backoff-millis at each iteration When on fail, client shuts down.
      Returns:
        failOnMaxBackoff

    - #### setFailOnMaxBackoff

          public ConnectionRetryConfig setFailOnMaxBackoff(boolean failOnMaxBackoff)

      Parameters:
        `failOnMaxBackoff` - whether to fail when the max-backoff has reached or continue waiting max-backoff-millis at each iteration
      Returns:
        updated ConnectionRetryConfig

    - #### getJitter

          public double getJitter()

      by how much to randomize backoffs. At each iteration calculated back-off is randomized via following method Random(-jitter * current_backoff, jitter * current_backoff)
      Returns:
        jitter

    - #### setJitter

          public ConnectionRetryConfig setJitter(double jitter)

      At each iteration calculated back-off is randomized via following method Random(-jitter * current_backoff, jitter * current_backoff)
      Parameters:
        `jitter` - by how much to randomize backoffs
      Returns:
        updated ConnectionRetryConfig

    - #### isEnabled

          public boolean isEnabled()

      enables connection retry logic. When disabled, old configurations are used: `ClientNetworkConfig.getConnectionAttemptLimit()` `ClientNetworkConfig.getConnectionAttemptPeriod()` ()}
      Returns:
        true if enabled

    - #### setEnabled

          public ConnectionRetryConfig setEnabled(boolean enabled)

      enables connection retry logic. When disabled, old configurations are used: `ClientNetworkConfig.getConnectionAttemptLimit()` `ClientNetworkConfig.getConnectionAttemptPeriod()` ()}
      Parameters:
        `enabled` -
      Returns:
        updated ConnectionRetryConfig

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2019. All rights reserved.