All applications
that communicate with remote
services and resources
must be sensitive to transient
faults. i.e. Exception
handling typically in java
world
. As network
conditions
between the client and the server may be variable
, especially when communication
crosses the Internet
. Hence, as developer we have to be extremely sensitive about these errors.
Here are few pointers to be considered about putting retry mechanism in place(I would like to call exception handling, because sometime retry immediately may not suite as an exception, response provide by server with active maintenance with end of maintenance established upfront).
- Determine if the operation is suitable for retrying
- Determine an appropriate retry count and interval
In my past, I myself has implemented JMS Queues for retry in Mule ESB
. Here are basic details-
- One
online
queue for sending message to remote.
- In case of failures, it sends out the messages to
error
queue and error queue usually polled after certain interval like half an hour or so.
Here are few good references.
For theory
Some basic Java code
Design pattern with Async retry
I hope it gives some pointers.