Skip to content

Expose the number of max attempts to the retry context for all policies #395

Closed
@e-ivaldi

Description

@e-ivaldi

It is sometimes useful to be aware, within a retry context, whether the current attempt is the last attempt when using a 'maximum number of attempts before failure' type of retry policy.

Following up on this discussion I am opening a small PR to add that type of support to spring-retry.

In order to achieve the desired result, for all policies, a new attribute is going to be added to the context named "context.max-attempts" that will contain the number of max attempts set in the policy, if any, or -1 otherwise.

The PR won't provide extra support to read and parse the attribute value via ad-hoc methods added to the retry contexts themselves.

PR link: #396

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions