GH-5185: Move async processing APIs to core#5409
Open
won-seoop wants to merge 1 commit into
Open
Conversation
pkernevez
reviewed
Jun 2, 2026
|
|
||
| @Override | ||
| public void beforeStep(StepExecution stepExecution) { | ||
| this.stepExecution = stepExecution; |
There was a problem hiding this comment.
I put the comment here as I don't really know where to put it as the class is on transit.
There is an existing bug here or at least an issue with the documentation.
When starting a new step we have to reset the state too:
Suggested change
| this.stepExecution = stepExecution; | |
| this.stepExecution = stepExecution; | |
| this.responses.clear(); | |
| this.sequence = 0; |
Without this, we mixe the state of the previous runs.
Or in the documentation show an example with a Scope more volatile than a singleton:
@Bean
public ChunkTaskExecutorItemWriter<Vet> itemWriter(ChunkProcessor<Vet> chunkProcessor) {
ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
taskExecutor.setCorePoolSize(4);
taskExecutor.setThreadNamePrefix("worker-thread-");
taskExecutor.setWaitForTasksToCompleteOnShutdown(true);
taskExecutor.afterPropertiesSet();
return new ChunkTaskExecutorItemWriter<>(chunkProcessor, taskExecutor);
}Signed-off-by: Won Hyeonseob <dongjin778@naver.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5185
This pull request moves async item processing and local chunking support into
spring-batch-core:AsyncItemProcessor,AsyncItemWriter, andChunkTaskExecutorItemWritertospring-batch-corespring-batch-integrationtypes as deprecated wrappers for source compatibilityValidation:
./mvnw -pl spring-batch-core -Dtest=AsyncItemProcessorTests,AsyncItemWriterTests,ChunkTaskExecutorItemWriterTests test./mvnw -pl spring-batch-integration,spring-batch-samples -am -DskipTests compileNote: local validation was run on JDK 21 with temporary compiler settings for NullAway JSpecify support; those local settings are not part of this pull request.