tags:

views:

27

answers:

2

Hi ,

I have written a service which is dependent on other other service. Usually if other service timeouts or not responding then my service response time is affected. Is there any way I can find out that for how much time the service outage is so taht i can wait for that many seconds and then retry.

Thanks, Shruti

A: 

In general: no, it's not possible, you probably shouldn't even know where the service is that you're accessing.
In your implementation: who knows, you might be lucky.
The normal way would be to wait for some time and then throw an exception.

stefaanv
A: 

Ideally you should have a timeout interval for your service. It should wait for that much time and then timeout, and further you can handle the error/exception scenario, wherein you wait for response again or propogate the error.
How much interval you should wait?
soley depends on what actions you have to take on the first timeout. Check resource etc that might have caused no response from other system?

Als