Örnek - timeout
Şöyle yaparız
RetryTemplate template = new RetryTemplate();TimeoutRetryPolicy policy = new TimeoutRetryPolicy();policy.setTimeout(30000L);template.setRetryPolicy(policy);Foo result = template.execute(new RetryCallback<Foo>() {@Overridepublic Foo doWithRetry(RetryContext context) {// Do stuff that might fail, e.g. webservice operationreturn result;}});
Hiç yorum yok:
Yorum Gönder