Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Retry mechanism

User_19BPUAug 18 2016 — edited Aug 19 2016

Hi,

I am calling a Webservice to check whether a particular service is down or up , if it is down, then I need to set the sleep interval for 5 minutes and then retry connecting the webservice for 5 attempts and see whether the response is positive – if all the 5 attempts failed then send an email.

If (service.getHealth()=null){

// set the sleep interval for 5 mintues

// set the retry mechnaoism for 5 attempts

If(all the 5 attempts = failed){

//sendEmail

}

}

Please let me know how we can do it ? which is the best way in handling the sleep and retry mechanism in java? Please provide your input.

Thanks

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 16 2016
Added on Aug 18 2016
5 comments
436 views