Annotation Type RpcRetry
-
@Inherited @Documented @Retention(RUNTIME) @Target(METHOD) public @interface RpcRetry
Marker annotation to enable retrying of failed RPC invocations.This annotation can be placed on a method of an
Rpc
-annotated interface in order to enable retrying of failed invocations.Generic parameters of the retry logic (like maximum attempts, delay between attempts, etc) can be specified at the RPC-client level via the
RpcClientConfig.setRetryPolicy(GenericRetryConfigurer)
or via theRpcClientBuilder.withRetryPolicy(GenericRetryConfigurer)
method. Specifying those parameters in the annotation attributes overrides those values (i.e. annotation attributes has higher priority over the generic defaults).- See Also:
RpcService
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description String
delay
Delay in milliseconds between attempts.Class<? extends Throwable>[]
errors
Base types of errors that can be retried.String
maxAttempts
Maximum amount of attempts.String
maxDelay
Maximum delay in milliseconds between attempts.
-
-
-
Element Detail
-
errors
Class<? extends Throwable>[] errors
Base types of errors that can be retried. If not specified then all errors will be retried.- Returns:
- Base types of errors that can be retried.
- See Also:
RetryPolicy.whileError(RetryErrorPredicate)
- Default:
- {}
-
-
-
maxAttempts
String maxAttempts
Maximum amount of attempts. Zero to disable retries, negative value for unlimited attempts.It is possible to use
${...}
property placeholders when Hekate is running inside of a Spring Application Context.- Returns:
- Maximum amount of attempts.
- See Also:
RetryPolicy.maxAttempts(int)
- Default:
- ""
-
-
-
delay
String delay
Delay in milliseconds between attempts.If this attribute is set but the
maxDelay()
is not set, then theFixedBackoffPolicy
will be used. IfmaxDelay()
attribute is also set then theExponentialBackoffPolicy
will be used.It is possible to use
${...}
property placeholders when Hekate is running inside of a Spring Application Context.- Returns:
- Delay in milliseconds between attempts.
- See Also:
RetryPolicy.withFixedDelay(long)
- Default:
- ""
-
-
-
maxDelay
String maxDelay
Maximum delay in milliseconds between attempts.If this attribute is set then the
ExponentialBackoffPolicy
will be used to calculate delay between attempts. In such case thedelay()
attribute's value will be used as a base delay and the value of this attribute as a maximum delay.It is possible to use
${...}
property placeholders when Hekate is running inside of a Spring Application Context.- Returns:
- Maximum delay in milliseconds between attempts.
- See Also:
RetryPolicy.withExponentialDelay(long, long)
- Default:
- ""
-
-