Interface TokenBucketExceptionCostFunction.Builder
-
- All Known Implementing Classes:
DefaultTokenBucketExceptionCostFunction.Builder
- Enclosing interface:
- TokenBucketExceptionCostFunction
@NotThreadSafe public static interface TokenBucketExceptionCostFunction.Builder
A helper that can be used to assign exception costs to specific exception types, created viaTokenBucketExceptionCostFunction.builder()
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TokenBucketExceptionCostFunction
build()
Create aTokenBucketExceptionCostFunction
using the values configured on this builder.TokenBucketExceptionCostFunction.Builder
defaultExceptionCost(int cost)
Specify the number of tokens that should be removed from the token bucket when no other exception type in this function is matched.TokenBucketExceptionCostFunction.Builder
throttlingExceptionCost(int cost)
Specify the number of tokens that should be removed from the token bucket when throttling exceptions (e.g.
-
-
-
Method Detail
-
throttlingExceptionCost
TokenBucketExceptionCostFunction.Builder throttlingExceptionCost(int cost)
Specify the number of tokens that should be removed from the token bucket when throttling exceptions (e.g. HTTP status code 429) are encountered.
-
defaultExceptionCost
TokenBucketExceptionCostFunction.Builder defaultExceptionCost(int cost)
Specify the number of tokens that should be removed from the token bucket when no other exception type in this function is matched. This field is required.
-
build
TokenBucketExceptionCostFunction build()
Create aTokenBucketExceptionCostFunction
using the values configured on this builder.
-
-