1
votes

I have a quite simple method within a Spring component class

@Service("wsOrderCreationService")
public class WsOrderCreationServiceImpl implements WsOrderCreationService {
...
public void saveLedger(SdiOrderSkuLedger orderSkuLedger)    {
    sdiOrderSkuLedgerService.save(orderSkuLedger);
}

I would like to apply retry to this method but I cannot use spring-retry 1.1.12 because my core Spring version is 3.0 and lower versions of spring-retry do not allow XML configuration. We are successfully using Spring Integration with retry in this application, so I am thinking of converting this method to SI workflow. What is the best way to do this conversion?

1

1 Answers

1
votes

Let me guess that you can use RequestHandlerRetryAdvice in the <request-handler-advice-chain> for the <service-activator>.

From other side you can build something like <gateway> for some service-interface and use that interface in some your service as an Integration front-end.

So, what you need for your purpose is a <gateway> which sends message to the <service-activator> with the RequestHandlerRetryAdvice for some service method which requires the retry logic.

That's how to answer to your particular question.

From other side the Spring Retry framework isn't designed for the the XML config because it is enough straightforward just for the regular <bean> definition. You should just configure RetryOperationsInterceptor (and its dependencies) via standard Spring AOP Framework.

From there you don't need to introduce the Spring Integration layer just for the simple retry around one service.