アノテーションインターフェース BackOff
RetryPolicy の一部として BackOff インスタンスを作成するためのメタデータを収集します。値はそのまま指定することも、より多くの形式と式の評価をサポートする *String 相当の値を使用して指定することもできます。使用可能な属性は次のとおりです。
- 明示的な設定がない場合、デフォルトは
FixedBackOffで遅延は 1000L ミリ秒です。 delay()のみ設定: その値で固定遅延バックオフ- それ以外の場合、
ExponentialBackOffはdelay()(デフォルト: 1000L ms)、maxDelay()(デフォルト: 最大値なし)、multiplier()(デフォルト: 1.0)、およびjitter()(デフォルト: ジッターなし) の値で作成されます。
- 導入:
- 4.0
- 作成者:
- Dave Syer, Gary Russell, Aftab Shaikh, Stephane Nicoll
フィールドのサマリー
フィールドオプション要素の概要
オプション要素修飾子と型オプションの要素説明long最初の呼び出し後の基本遅延を指定します。文字列形式を使用して、最初の呼び出し後の基本遅延を指定します。long文字列形式を使用して、基本再試行のジッター値を指定します。long文字列形式を使用して、再試行の最大遅延を指定します。double文字列形式を使用して、次回の再試行までの遅延の乗数を指定します。longdelay()のエイリアス。
フィールドの詳細
DEFAULT_DELAY
要素の詳細
value
delay
最初の呼び出し後の基本遅延を指定します。If only a
delayis specified, aFixedBackOffwith that value as the interval is configured.乗数を指定した場合、これが乗算する初期遅延として機能します。
デフォルトは 1000L ミリ秒です。
- 戻り値:
- ミリ秒単位のベース遅延 (デフォルトの 1000L )
- デフォルト:
1000L
delayString
StringSE delayStringSpecify the base delay after the initial invocation using a String format. If this is specified, takes precedence overdelay().The delay String can be in several formats:
- a plain long — which is interpreted to represent a duration in milliseconds
- any of the known
DurationFormat.Style: theISO8601style or theSIMPLEstyle — using milliseconds as fallback if the string doesn't contain an explicit unit - Regular expressions, such as
${example.property}to use theexample.propertyfrom the environment
- 戻り値:
- the based delay as a String value — for example a placeholder
- 関連事項:
- デフォルト:
""
maxDelay
long maxDelay再試行の最大遅延を指定し、ジッターと乗数によって遅延が増加する範囲を制限します。Ignored if only
delay()is set, otherwise anExponentialBackOffwith the given max delay or an unlimited delay if not set.- 戻り値:
- the maximum delay
- デフォルト:
0L
maxDelayString
StringSE maxDelayStringSpecify the maximum delay for any retry attempt using a String format. If this is specified, takes precedence overmaxDelay()..The max delay String can be in several formats:
- a plain long — which is interpreted to represent a duration in milliseconds
- any of the known
DurationFormat.Style: theISO8601style or theSIMPLEstyle — using milliseconds as fallback if the string doesn't contain an explicit unit - Regular expressions, such as
${example.property}to use theexample.propertyfrom the environment
- 戻り値:
- the max delay as a String value — for example a placeholder
- 関連事項:
- デフォルト:
""
multiplier
double multiplierSpecify a multiplier for a delay for the next retry attempt, applied to the previous delay, starting with the initial delay as well as to the applicable jitter for each attempt.Ignored if only
delay()is set, otherwise anExponentialBackOffwith the given multiplier or1.0if not set.- 戻り値:
- the value to multiply the current interval by for each attempt
- デフォルト:
0.0
multiplierString
StringSE multiplierStringSpecify a multiplier for a delay for the next retry attempt using a String format. If this is specified, takes precedence overmultiplier().The multiplier String can be in several formats:
- a plain double
- Regular expressions, such as
${example.property}to use theexample.propertyfrom the environment
- 戻り値:
- the value to multiply the current interval by for each attempt — for example, a placeholder
- 関連事項:
- デフォルト:
""
jitter
long jitter計算された遅延に対してランダムに減算または加算される基本再試行のジッター値を指定します。結果はdelay - jitterとdelay + jitterの間の値になりますが、基本遅延を下回ったり最大遅延を超えたりすることはありません。乗数を指定した場合、ジッター値にも適用されます。
Ignored if only
delay()is set, otherwise anExponentialBackOffwith the given jitter or no jitter if not set.- 戻り値:
- ジッター値(ミリ秒)
- 関連事項:
- デフォルト:
0L
jitterString
StringSE jitterStringSpecify a jitter value for the base retry attempt using a String format. If this is specified, takes precedence overjitter().The jitter String can be in several formats:
- a plain long — which is interpreted to represent a duration in milliseconds
- any of the known
DurationFormat.Style: theISO8601style or theSIMPLEstyle — using milliseconds as fallback if the string doesn't contain an explicit unit - Regular expressions, such as
${example.property}to use theexample.propertyfrom the environment
- 戻り値:
- the jitter as a String value — for example, a placeholder
- 関連事項:
- デフォルト:
""