cancel
Showing results for 
Search instead for 
Did you mean: 

retry action in order-process

0 Kudos

Hi everyone!

We currently have "known issues" with our tax calculator third party due to timeouts or the server being down so as part of the order-process we need to add retries (3-5) before failing the process altogether but I was not able to find a way to state that in the XML file so the idea would be something like this:

 <action id="calculateTAX" bean="calculateTAXbean">
     <transition name="OK" to="successful"/>
     <transition name="NOK" to="checkAction"/>
 </action>

 <action id="checkAction" bean="checkActionBean">
     <transition name="OK" to="successful"/>
     <transition name="NOK" to="calculateTAX"/> <!-- 3-5 times only! Otherwise, fail the process -->
 </action>


The "manual" way to achieve this would be to add as many actions as retry attempts I need but I was wondering if there's a better way to achieve this?

An additional way to handle this would be to have the code for calculateTAX and checkAction in the same bean but it might be more invasive that way.

Thanks in advance!

Accepted Solutions (0)

Answers (3)

Answers (3)

former_member537989
Contributor
0 Kudos

See the doc on retry mechanism

former_member636115
Discoverer
0 Kudos

Hi Fernandez,

in your ActionBean you have to throw an exception:

 throw new RetryLaterException();

y_elpyaz
Participant
0 Kudos

Hi Fernandez,

To get around this problem you may try with Hystrix or take a look into SpringRetry