cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

retry action in order-process

Former Member
0 Likes
1,461

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 Member
0 Likes

See the doc on retry mechanism

Former Member
0 Likes

Hi Fernandez,

in your ActionBean you have to throw an exception:

 throw new RetryLaterException();

y_elpyaz
Participant
0 Likes

Hi Fernandez,

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