I am using Annotation based Spring Retry. Below is my interface:
public interface IRetriever
{
@Retryable(interceptor="RetryInterceptor")
public abstract List<Item> retrieve(final LogData transactionLogData, final RetrieveRequestType rqObject) throws InternalException, OpaqueExternalException;
}
There are three classes that implement this interface to call downstream services. I want to define RetryInterceptors such that for each downstream call, I should be able to define a separate retry Policy. In essence, I want to change RetryInterceptor at runtime.
Is there a way in Spring where I can change RetryInterceptor at runtime and make the code use a particular RetryOperationsInterceptor?