Package org.jeasy.batch.core.processor
Class RetryableRecordProcessor<I,O>
- java.lang.Object
-
- org.jeasy.batch.core.processor.RetryableRecordProcessor<I,O>
-
- All Implemented Interfaces:
RecordProcessor<I,O>
public class RetryableRecordProcessor<I,O> extends java.lang.Object implements RecordProcessor<I,O>
Decorator that makes aRecordProcessor
retryable whenever an exception is thrown while processing a record. This decorator is useful in case of a transient error where a retry might succeed.- Author:
- Mahmoud Ben Hassine ([email protected])
-
-
Constructor Summary
Constructors Constructor Description RetryableRecordProcessor(RecordProcessor<I,O> delegate, RetryPolicy retryPolicy)
Create a newRetryableRecordProcessor
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Record<O>
processRecord(Record<I> record)
Process a record.
-
-
-
Constructor Detail
-
RetryableRecordProcessor
public RetryableRecordProcessor(RecordProcessor<I,O> delegate, RetryPolicy retryPolicy)
Create a newRetryableRecordProcessor
.- Parameters:
delegate
- record processorretryPolicy
- to apply
-
-
Method Detail
-
processRecord
public Record<O> processRecord(Record<I> record) throws java.lang.Exception
Description copied from interface:RecordProcessor
Process a record.- Specified by:
processRecord
in interfaceRecordProcessor<I,O>
- Parameters:
record
- to process.- Returns:
- the processed record, may be of a different type than the input record, or
null
to skip next processors - Throws:
java.lang.Exception
- if an error occurs during record processing
-
-