You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Spring Retry is configured in project with recover/fallback method, in case of exception assault on service class, fallback method/recover method is not getting called.
NOTE: In case of service assault, retry functionality is working fine but fallback method is not getting called at the end.
Expected Behavior
Recover method should be called in case of service assault.
Current Behavior
Only retry functionality is working fine but when retries are exhausted then at the end recover method is not getting called.
(Already cross checked the recover method signature. Same is working fine in case of RestTeamplate assault but it is not working in case of service Assault.)
Steps to Reproduce
Create a service class with a method and configure spring retry using @retryable annotation. Specify the exception type for which retry should be performed and number of time the retry should be performed.
In the same service class, create a recover method using @recover annotation, specify the same exception inside method signature for which retry was configured in step-1.
Enable exception assault on service class
During the assault, notice that the retry functionality is working fine but recover method is not getting called when retries are exhausted.
Context (Environment)
This will be helpful to test the real world scenarios in which fallback methods are called when retries are exhausted.
The text was updated successfully, but these errors were encountered:
bunty-raghani
changed the title
Spring Retry - Recover method not getting called in case of Service Assault
Spring Retry - Recover method not getting called in case of Exception Assault on Service class
Sep 11, 2023
Chaosmonkey always attacks whole classes, so a recover in the same service cannot work because the recover function itself will also be attacked.
I suppose the improvement here would be to somehow allow a configuration to ignore that method (name based/annotation based?)
When Spring Retry is configured in project with recover/fallback method, in case of exception assault on service class, fallback method/recover method is not getting called.
NOTE: In case of service assault, retry functionality is working fine but fallback method is not getting called at the end.
Expected Behavior
Recover method should be called in case of service assault.
Current Behavior
Only retry functionality is working fine but when retries are exhausted then at the end recover method is not getting called.
(Already cross checked the recover method signature. Same is working fine in case of RestTeamplate assault but it is not working in case of service Assault.)
Steps to Reproduce
Context (Environment)
This will be helpful to test the real world scenarios in which fallback methods are called when retries are exhausted.
The text was updated successfully, but these errors were encountered: