github spring-projects/spring-batch v6.1.0

one hour ago

❗ This release introduces a few minor breaking changes. Please refer to the What's new section of the reference documentation for details about each of them.

⭐ New features

  • Provide a @JobParameter annotation for more convenient access to variables in JobParameters. #5563
  • Allow to use Mongo JobRepository with any PlatformTransactionManager #5508
  • Add a builder for ResourcesItemReader with support for specifying resources via a pattern #5487
  • Add PageableItemReader #5477
  • Make JsonLineMapper agnostic to the JSON library #5345
  • Introduce JsonLineAggregator for FlatFileItemWriter to write JSON Lines format file #5344
  • Introduce BatchConstants #5190
  • Supports to create step execution with context #5184
  • Default reader/writer name to the bean name #5149
  • Support specifying resource locations using a pattern in MultiResourceItemReaderBuilder #5056
  • Add support for custom collection prefix in MongoDB Job repository #4980
  • Add compile-time safety for mutually exclusive builder methods #4888
  • Add schema locations to DatabaseType to prevent typos in the metadata tables string path #4586

🚀 Enhancements

  • Introduce RemoteChunkingManagerBuilder and deprecate RemoteChunkingManagerStepBuilder and its factory #5598
  • JdbcJobExecutionDao.findJobExecutions issues 1 + 3N queries for N executions #5570
  • Polish DatabaseType #5542
  • Remove redundant methods which are identical to default method #5516
  • Inconsistent builder method name: MultiResourceItemReaderBuilder.setStrict() #5512
  • Improve DefaultJobParametersConverter and JsonJobParametersConverter #5457
  • Replace isAssignableFrom() with isInstance() where feasible #5427
  • Remove unused ClassUtils import from JdbcPagingItemReader #5407
  • Add @FunctionalInterface to StepInterruptionPolicy #5402
  • Fix SimpleJobOperator jobRegistry state message #5369
  • Improve JdbcJobExecutionDao#synchronizeStatus(StepExecution) #5365
  • Replace deprecated Jackson2JsonMessageConverter with JacksonJsonMessageConverter #5350
  • Replace System.getProperty("line.separator") with System.lineSeparator() #5341
  • Remove unnecessary null check against createTime of execution #5304
  • Inaccurate exception message when attempting to start a running job #5280
  • Improve JacksonExecutionContextStringSerializer #5233
  • Replace custom converters with DefaultFormattingConversionService #5186
  • Move async processing APIs to spring-batch-core #5185
  • Replace CopyOnWriteArrayList with ArrayList in JdbcPagingItemReader and JpaPagingItemReader for performance and correctness #5112
  • Add flushing support in RepositoryItemWriter #5073
  • Refactor JDBC DAOs to use named parameters instead of positional parameters and JdbcClient instead of JdbcTemplate #4804
  • Eliminate unnecessary query for current version #4797
  • Poll workers of a partitioned step with a database query #4705
  • Running a job causes retrieval of full history of job executions #4169
  • Not unique steps names in a FlowJob should log a warning #3757

🐞 Bug fixes

  • ChunkOrientedStep ends COMPLETED when its thread is interrupted, leaving items unprocessed #5639
  • Retrying a failed read of a paging item reader silently loses items #5627
  • Write count is doubled in a remote chunking manager step (ChunkMessageChannelItemWriter) #5606
  • Restart after a chunk scan that ended with a skipped item processes that item again #5599
  • MultiResourceItemWriter does not validate non-positive itemCountLimitPerResource values #5597
  • ChunkOrientedStep does not restore the step execution when a chunk transaction is not committed #5594
  • CompositeItemReader re-reads items on restart when a chunk spans two delegates #5591
  • MongoCursorItemReader throws NullPointerException when closed before opening #5589
  • MariaDB 6.0 migration fails when renaming BATCH_JOB_SEQ #5586
  • listener exceptions are skippable in scan mode but fatal elsewhere #5585
  • Fix missing page increase in AbstractPaginatedDataItemReader #5583
  • Job-scoped beans are not usable from worker threads of multi-threaded steps and parallel flows #5576
  • BatchObservabilityBeanPostProcessor doesn't respect manually configured observationRegistry #5566
  • Failed job launch leaves an orphan JobInstance behind #5562
  • Restart after a failure during chunk scanning skips the remaining items of the chunk in ChunkOrientedStep #5558
  • Repository/DAO-level count methods cannot soundly validate job/step existence #5544
  • NullPointerException when closing an unopened JpaPagingItemReader #5539
  • @OnSkipInRead/@OnSkipInProcess/@OnSkipInWrite methods are ignored by ChunkOrientedStepBuilder#listener(Object) #5531
  • Misleading logs in scan mode without retries #5527
  • FlatFileItemReaderBuilder.addComment() throws UnsupportedOperationException after comments(...) #5520
  • DelimitedLineTokenizer throws StringIndexOutOfBoundsException when a field is a single quote character #5519
  • FixedLengthTokenizer in strict mode rejects lines when the open-ended range starts at or before the first range's min #5518
  • JobFlowExecutor leaks a StepExecution across job executions on a shared thread when no transition matches a step's ExitStatus #5514
  • Rolled-back chunk counted as written and step COMPLETED in ChunkOrientedStep (fault-tolerant retry of OptimisticLockException) #5509
  • TransientTransactionError in MongoSequenceIncrementer during parallel job executions #5507
  • Fix QName deserialization in JacksonExecutionContextStringSerializer #5502
  • Incorrect deserialization in JobParameterDeserializer #5498
  • Incorrect deserialization in DefaultExecutionContextSerializer #5497
  • Incorrect handling of malformed input in FlatFileItemReader #5496
  • ChunkOrientedStep scan mode passes the processed chunk to ChunkListener#beforeChunk and silently drops scan items when the listener throws #5493
  • ChunkOrientedStep does not re-invoke the ItemProcessor during chunk scanning, unlike FaultTolerantChunkProcessor #5490
  • JpaCursorItemReader.doClose() missing null check on entityManager #5486
  • Fix incorrect nullability contract for encoding in StaxEventItemReader #5483
  • JsonFunctionalTests fails on Windows due to CRLF #5481
  • @OnChunkError is never invoked on a chunk-oriented step #5468
  • Interface listener callbacks are invoked twice when an item handler also has a listener annotation #5466
  • spring.batch.job.launch.count is silently missing: the JobOperator keeps ObservationRegistry.NOOP on most configuration paths #5463
  • Inconsistent JobParameter type handling between storage and retrieval in Spring Batch 6.x #5455
  • @BeforeStep/@AfterStep methods are ignored by ChunkOrientedStepBuilder#listener(Object) #5451
  • Replace jetbrains @NotNull with jspecify @NonNull #5443
  • SimpleJobOperator.restart(JobExecution) masks the real failure reason with a misleading "job execution already running" message #5439
  • Missing GraalVM runtime hints for MongoDB persistence model classes and resources #5435
  • Fix JsonFileItemWriter to produce valid JSON when append allowed with custom header/footer callback #5432
  • Step name is null when the step is not defined as a bean and not assigned a name #5278
  • Aggregator of remote partitions is not passed all worker steps upon controller restart #5158
  • Forced Sort Passing via sorts() Method When Building with MongoCursorItemReaderBuilder and Query #4860
  • Multi-threaded worker step hangs during shutdown in remote partitioning #4431
  • Incorrect invocation order of job execution listener in remote partitioning #4133
  • Remote-chunking implementation does not support parallel executions of the same job #1372
  • JdbcPagingItemReader fails to resolve table-qualified sort keys #1208
  • Step ExecutionContext gets updated on transaction rollback #1145

📔 Documentation

  • JpaItemWriter description in Appendix of documentation is wrong #5556
  • Fix Javadoc #5545
  • Inaccurate documentation of remote chunking and remote partitioning samples regarding JMS headers #5513
  • Fix typos in Javadoc comments #5511
  • Clarify retryable reads compatibility with forward-only semantics #5510
  • Clarify SkipListener contract and reference docs about transaction scope #5494
  • Reference documentation's tracing example registers a handler that creates no spans and fails the job #5475
  • Fix typo in Javadoc of JobOperator.start() #5434
  • Wrong example in Registering ItemStream with a Step #5429
  • Fix incorrect Javadoc reference in JobExecution.isStopped() #5414
  • Fix javadoc in SqlPagingQueryUtils #5403
  • Fix typo in EnableBatchProcessing Javadoc #5375
  • Inaccurate JavaDoc of BatchStatus.isLessThanOrEqualTo #5285
  • Enhance documentation about leveraging IteratorItemReader to reuse scrolling APIs from Spring Data #4484

🔨 Tasks

  • Deprecate JobExecution convenience getters for JobInstance id #5533
  • Consistently use .version suffix for version properties in pom.xml #5506
  • Update Apache Artemis groupId to org.apache.artemis #5482
  • Deprecate setRepository in RepositoryItemWriter #5473
  • Deprecate setRepository and setSorts in RepositoryItemReader #5472
  • Update Groovy version to 5.1.2 #5327
  • Deprecate Derby support since Apache Derby is retired #5254
  • Deprecate JobInstance::getInstanceId for removal to eliminate redundancy #5244
  • Deprecate StepExecution convenience getters for JobExecution id and parameters #5142
  • Deprecate setEntityManagerFactory in JPA item readers/writer #5101

🆙 Dependency Upgrades

Spring dependencies

Spring Framework: 7.0.10 -> 7.1.0
Spring Integration: 7.0.7 -> 7.2.0
Spring AMQP: 4.0.6 -> 4.2.0
Spring Kafka: 4.0.8 -> 4.2.0
Spring Data: 2025.1.8 -> 2026.1.0
Spring LDAP: 4.0.6 -> 4.2.0
Micrometer: 1.16.8 -> 1.18.0

Other dependencies

AspectJ: 1.9.25.1 -> 1.9.27
Gson: 2.13.2 -> 2.15.0
Jackson: 3.1.7 -> 3.2.4
JUnit Jupiter: 6.0.3 -> 6.1.3

❤️ Contributors

Thank you to all the contributors who worked on this release:

@acktsap, @Adrastopoulos, @ahrytsiuk, @Akhil-1527, @AndreaBosmanWork, @apptie, @banseok1216, @benelog, @beyondwin, @cladren123, @COBI-98, @dhritimanchakra, @DragonFSKY, @enduf7686, @GaBaljaintheroom, @Gorock, @hunseonglee, @hutiefang76, @HyunWoo9930, @Ichanskiy, @jjh75607, @jjj-n, @klopfdreh, @KMGeon, @kojw1017, @kyungrae, @leedaegeon, @leestana01, @maequise, @mjd507, @noojung, @padosol, @PauliusPeciura, @pius712, @quaff, @ryujungkyun, @scordio, @SHINMH, @siddiqueirshad, @snowykte0426, @UsmanEjaz10, @won-seoop, @xxxxxxjun, and @yuseogi0218

Don't miss a new spring-batch release

NewReleases is sending notifications on new releases.