Interface TokenBucketExceptionCostFunction.Builder
- All Known Implementing Classes:
DefaultTokenBucketExceptionCostFunction.Builder
- Enclosing interface:
TokenBucketExceptionCostFunction
A helper that can be used to assign exception costs to specific exception types, created via
TokenBucketExceptionCostFunction.builder()
.-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Create aTokenBucketExceptionCostFunction
using the values configured on this 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.throttlingExceptionCost
(int cost) Specify the number of tokens that should be removed from the token bucket when throttling exceptions (e.g.
-
Method Details
-
throttlingExceptionCost
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
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.
-