Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

handling timeouts

 
Ansari Raffik
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone suggest me how a java client invoking a https service handle time-outs?..
 
Philip Shanks
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I suppose it depends on the Http client that you choose.

The Jakarta Commons HttpClient has a TimeoutController class that allows you to execute either a Runnable or Thread object with a specified timeout. It throws a TimeoutController.TimeoutException.

What you do to handle such an exception depends entirely on the application requirements. You could retry the task immediately, log the event and exit, rotate the task to the end of the queue, or any other scheme that you choose.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic