Skip to content

Accept maxAttempts(0) in RetryPolicy builder #35362

@jhoeller

Description

@jhoeller

Along with #35351, we should accept specifying maxAttempts as 0, indicating no retries at all. This is particularly useful with a placeholder along the lines of @Retryable(maxAttemptsString = "${limitedAttempts}") that can be externally configured to turn off retries completely.

The underlying BackOff implementations accept maxAttempts=0 already, this just needs to be relaxed in the RetryPolicy builder itself.

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