Examples of BatchRetryTemplate


Examples of org.springframework.batch.core.step.item.BatchRetryTemplate

  }

  protected ChunkProcessor<I> createChunkProcessor() {

    BatchRetryTemplate batchRetryTemplate = createRetryOperations();

    FaultTolerantChunkProcessor<I, O> chunkProcessor = new FaultTolerantChunkProcessor<I, O>(getProcessor(),
        getWriter(), batchRetryTemplate);
    chunkProcessor.setBuffering(!isReaderTransactionalQueue());
    chunkProcessor.setProcessorTransactional(processorTransactional);
View Full Code Here

Examples of org.springframework.batch.core.step.item.BatchRetryTemplate

      retryPolicy = compositeRetryPolicy;
    }

    RetryPolicy retryPolicyWrapper = getFatalExceptionAwareProxy(retryPolicy);

    BatchRetryTemplate batchRetryTemplate = new BatchRetryTemplate();
    if (backOffPolicy != null) {
      batchRetryTemplate.setBackOffPolicy(backOffPolicy);
    }
    batchRetryTemplate.setRetryPolicy(retryPolicyWrapper);

    // Coordinate the retry policy with the exception handler:
    RepeatOperations stepOperations = getStepOperations();
    if (stepOperations instanceof RepeatTemplate) {
      SimpleRetryExceptionHandler exceptionHandler = new SimpleRetryExceptionHandler(retryPolicyWrapper,
          getExceptionHandler(), nonRetryableExceptionClasses);
      ((RepeatTemplate) stepOperations).setExceptionHandler(exceptionHandler);
    }

    if (retryContextCache != null) {
      batchRetryTemplate.setRetryContextCache(retryContextCache);
    }

    if (retryListeners != null) {
      batchRetryTemplate.setListeners(retryListeners.toArray(new RetryListener[0]));
    }
    return batchRetryTemplate;

  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.