Skip to content

Can't chose correct @Recover method #188

Closed
@xytrams

Description

@xytrams

In case of multiple @Recover method, apparently only one is considered, others are ignored.
Example:

@CircuitBreaker(openTimeout=1000, resetTimeout=2000, maxAttempts=2)
public Response submit(Object o) {
... retry logic with retryTemplate
}
@CircuitBreaker(openTimeout=1000, resetTimeout=2000, maxAttempts=2)
public Response query(String id) {
... retry logic with retryTemplate
}
@Recover
public Response fallbackForSubmit(Throwable e, Object o) {....}
@Recover 
public Response fallbackForQuery(Throwable e, String id) (....}

In my case fallbackForQuery is not considered as recovery method.
If I comment out fallbackForSubmit recover method - than it works.

I've seen there were some changes introduced to allow to add @Retry(recoverName="recover1") in #85 , but it is not exactly my scenario since I'm not using @Retry annotation but rather retryTemplate.

Could you advise how should I proceed with my problem?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions