private FaultTolerantChunkProcessor<I, O> createChunkProcessor() {

    BatchRetryTemplate batchRetryTemplate = createRetryOperations();

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

    SkipPolicy writeSkipPolicy = createSkipPolicy();
    writeSkipPolicy = getFatalExceptionAwareProxy(writeSkipPolicy);
    chunkProcessor.setWriteSkipPolicy(writeSkipPolicy);
    chunkProcessor.setProcessSkipPolicy(writeSkipPolicy);
    chunkProcessor.setRollbackClassifier(getRollbackClassifier());
    chunkProcessor.setKeyGenerator(keyGenerator);
    detectStreamInReader();

    ArrayList<StepListener> listeners = new ArrayList<StepListener>(getItemListeners());
    listeners.addAll(skipListeners);
    chunkProcessor.setListeners(listeners);
    chunkProcessor.setChunkMonitor(chunkMonitor);

    return chunkProcessor;
  }