Skip to content

Support timeouts in @Retryable and RetryPolicy #35963

@sbrannen

Description

@sbrannen

Overview

@Retryable currently does not support the configuration of a timeout.

Similarly, it is currently not possible to implement a timeout with RetryPolicy and RetryTemplate since a BackOff policy is only applied to retry attempts which do not include the initial attempt.

We should therefore provide a timeout attribute in @Retryable and the ability to configure a timeout with the RetryPolicy.Builder.

For imperative operations, the timeout will need to be part of the configured RetryPolicy which the RetryTemplate can then use to implement the timeout.

For reactive pipelines with @Retryable, we should be able to use the built-in timeout support in Project Reactor.

In any case, the timeout should apply to the initial attempt as well as all retry attempts.

Related Issues

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions