From 9059a9e83ee42024c423bba4f9ed1dab2d4ab19c Mon Sep 17 00:00:00 2001 From: Michael Minella Date: Thu, 14 May 2015 23:15:12 -0500 Subject: [PATCH] Added documentation to communicate limitations of when using the AsyncItemProcessor. BATCH-2371 --- .../batch/integration/async/AsyncItemProcessor.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/AsyncItemProcessor.java b/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/AsyncItemProcessor.java index a90af2f51..371ddc2ae 100644 --- a/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/AsyncItemProcessor.java +++ b/spring-batch-integration/src/main/java/org/springframework/batch/integration/async/AsyncItemProcessor.java @@ -33,11 +33,19 @@ import org.springframework.util.Assert; * background. To allow for background processing the return value from the * processor is a {@link Future} which needs to be unpacked before the item can * be used by a client. + * + * Because the {@link Future} is typically unwrapped in the {@link ItemWriter}, + * there are lifecycle and stats limitations (since the framework doesn't know + * what the result of the processor is). While not an exhaustive list, things like + * {@link StepExecution#filterCount} will not reflect the number of filtered items + * and {@link org.springframework.batch.core.ItemProcessListener#onProcessError(Object, Exception)} + * will not be called. * * @author Dave Syer * * @param the input object type * @param the output object type (will be wrapped in a Future) + * @see AsyncItemWriter */ public class AsyncItemProcessor implements ItemProcessor>, InitializingBean {