Skip to content

Commit 9059a9e

Browse files
committed
Added documentation to communicate limitations of when using the
AsyncItemProcessor. BATCH-2371
1 parent bfaaf20 commit 9059a9e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

spring-batch-integration/src/main/java/org/springframework/batch/integration/async/AsyncItemProcessor.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,19 @@
3333
* background. To allow for background processing the return value from the
3434
* processor is a {@link Future} which needs to be unpacked before the item can
3535
* be used by a client.
36+
*
37+
* Because the {@link Future} is typically unwrapped in the {@link ItemWriter},
38+
* there are lifecycle and stats limitations (since the framework doesn't know
39+
* what the result of the processor is). While not an exhaustive list, things like
40+
* {@link StepExecution#filterCount} will not reflect the number of filtered items
41+
* and {@link org.springframework.batch.core.ItemProcessListener#onProcessError(Object, Exception)}
42+
* will not be called.
3643
*
3744
* @author Dave Syer
3845
*
3946
* @param <I> the input object type
4047
* @param <O> the output object type (will be wrapped in a Future)
48+
* @see AsyncItemWriter
4149
*/
4250
public class AsyncItemProcessor<I, O> implements ItemProcessor<I, Future<O>>, InitializingBean {
4351

0 commit comments

Comments
 (0)