Results 1 to 3 of 3

Thread: Nesting Retry inside Repeat

  1. #1
    Join Date
    Jan 2008
    Posts
    23

    Question Nesting Retry inside Repeat

    Hi All,
    I saw the NestedRepeatCallback class which nests a RepeatTemplate inside a RepeatTemplate. Is there any example of how to have a nested RetryTemplate inside a RepeatTemplate ?

    Any help will be appreciated.

    Thanks.
    Abhi

  2. #2
    Join Date
    Dec 2006
    Posts
    1,061

    Default

    Something like the following should work:

    Code:
    repeatTemplate.iterate(new RepeatCallback() {
    
    				public ExitStatus doInIteration(final RepeatContext context) throws Exception {
    
    					retryTemplate.execute(new RetryCallback(){
    
    						public Object doWithRetry(RetryContext context)
    								throws Throwable {
    							retryableOperation();
    							return null;
    						}});
    				}
    			});

  3. #3
    Join Date
    Jan 2008
    Posts
    23

    Default

    Thanks for the response.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •