0

Can anybody suggest a library or your own method in Java, Im willing to read/explore it myself, on how to handle SOAP interruption errors. For example, if I'm sending data to a website and internet connection is suddenly cut, how to create a Retry Mechanism so it sends the data again for N tries.

Any pointers are welcome.

ReyAnthonyRenacia
  • 17,219
  • 5
  • 37
  • 56
  • I have the same thing now but cannot find any answers. Getting a WebServiceException from Apache CXF does not give any hint at all whether I should retry or can stop trying to send... this CXF is really a BAD library.. – Zordid Jun 21 '23 at 10:57

1 Answers1

1

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).

  1. Determine if the operation is suitable for retrying
  2. 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-

  1. One online queue for sending message to remote.
  2. 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.

Red Boy
  • 5,429
  • 3
  • 28
  • 41