Spring Batch 6.0.2 现已发布,包含多项改进、错误修复及文档更新。具体更新内容如下:
New features
Bug fixes
- 从
CommandLineJobRunner迁移至CommandLineJobOperator时 v5 与 v6 的兼容性问题 #5227
- MongoStepExecutionDao.countStepExecutions() 忽略 stepName 参数#5220
- 由于 graceful shutdown 过程中的竞争条件,导致 OptimisticLockingFailureException 异常 #5217
- ChunkOrientedStep#doExecute 更新了块事务边界之外的 StepExecution #5199
- Jackson2ExecutionContextStringSerializer 无法序列化 JobStep 中的作业参数 #5191
- 在并行块处理期间,StepContribution 计数器不是线程安全的 #5188
- 在多线程 ChunkOrientedStep 中使用
@StepScopeItemProcessor 时出现 ScopeNotActiveException 异常 #5183
- ChunkOrientedStep 即使在数据块执行失败的情况下也会更新 ExecutionContext,导致重启时数据丢失#5182
- 当
@SpringBatchTest激活时,MetaDataInstanceFactory 的默认值会导致 StepScopeTestUtils 中 StepContext 冲突 #5181
- DB2LUW 数据库迁移到 spring-batch 6.x 时出现错误 #5166
- 自 Spring Batch 5.2.3 起,JobRepositoryTestUtils.removeJobExecutions() 中出现 OptimisticLockingFailureException 异常 #5161
- AbstractPaginatedDataItemReader 中的 jumpToItem(int itemLastIndex) 实现无法正确处理重启行为 #5136
- AbstractCursorItemReader#doClose 中资源清理顺序错误导致行为不一致 #5109
- 使用 asyncTaskExecutor 和 jobOperator.start() 启动作业时出现间歇性 OptimisticLockingFailureException 异常 #5106
- 将 StaxEventItemWriter 与 MultiResourceItemWriter 结合使用时出现 ClosedChannelException 异常 #5098
- 并行作业执行期间 MongoSequenceIncrementer 中的写入冲突 #4960
Enhancements
- 使用 Spring Framework 的 CollectionUtils 创建 HashSet/HashMap #5175
- 移除 StoredProcedureItemReader 中的冗余断言#5119
Documentation
- 修复 whatsnew.adoc 和集成测试中的拼写错误#5207
- 明确 v6 版本中 ChunkListener 的变更#5226
- v6 版本中关于并发步骤的文档有误#5228
- 正确的 JobOperatorFactoryBean 示例代码 #5103
Tasks
Dependency Upgrades
- Spring Framework: 7.0.3
- Spring Integration: 7.0.2
- Spring AMQP: 4.0.2
- Spring Kafka: 4.0.2
- Spring Data: 4.0.2
- Micrometer: 1.16.2
更新说明:https://github.com/spring-projects/spring-batch/releases/tag/v6.0.2