news 2026/6/10 16:13:44

Spring Batch 4.2.0.M2(里程碑版本2)是 Spring Batch 4.2 系列的早期预发布版本

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
Spring Batch 4.2.0.M2(里程碑版本2)是 Spring Batch 4.2 系列的早期预发布版本

Spring Batch 4.2.0.M2(里程碑版本2)是 Spring Batch 4.2 系列的早期预发布版本,于 2019 年底左右发布,主要用于引入新特性和改进,为正式版(GA)做准备。该版本基于 Spring Framework 5.2 和 Spring Boot 2.2,增强了对响应式编程、Java 11+ 支持、任务执行上下文优化、JobParameters 增强以及更灵活的 Step 扩展机制等。需要注意的是,M2 属于非生产就绪的开发预览版,不建议用于生产环境。

常见更新亮点包括:

  • 支持JobExecutionListenerStepExecutionListener的函数式注册方式;
  • 改进JdbcCursorItemReaderJdbcPagingItemReader的事务与资源管理;
  • 引入DefaultBatchConfiguration简化自动配置;
  • JobLauncherJobRepository的底层抽象进一步解耦;
  • 修复多个已知并发与重启相关 bug(如JobInstance冗余创建问题)。

如需使用,请在 Maven 中声明仓库(Spring Milestones)并添加依赖:

<repository><id>spring-milestones</id><name>Spring Milestones</name><url>https://repo.spring.io/milestone</url></repository>

依赖坐标:

<dependency><groupId>org.springframework.batch</groupId><artifactId>spring-batch-core</artifactId><version>4.2.0.M2</version></dependency>

⚠️ 提示:当前(2024年)最新稳定版为 Spring Batch 5.x(如 5.1.x),基于 Spring Framework 6+ 和 Jakarta EE 9+,若新项目建议直接采用 Spring Boot 3.x + Spring Batch 5.x 组合。

I am pleased to announce that Spring Batch 4.2.0.M2 is available now from our milestone repository.
What’s new?

This release adds a new item reader and a new item writer for Apache Kafka:

KafkaItemReader can read messages from a single partition or multiple partitions of the same topic. This reader stores message offsets in the ExecutionContext to support restart. KafkaItemWriter uses a KafkaTemplate from the Spring for Apache Kafka project to send messages to a given topic.

I would like to thank Mathieu Ouellet for his amazing contribution in adding support for Apache Kafka in Spring Batch!
Feedback

Spring Batch 4.2.0.M2 can be consumed with Spring Boot 2.2.0.M3. We look forward to hearing your feedback on this second milestone! Feel free to ping @michaelminella or @benason Twitter or to ask your question on StackOverflow or Gitter. If you find any issue, please open a ticket on Jira.

此版本为Apache Kafka添加了新的项目读取器和新的项目写入器:

KafkaItemReader可以从同一主题的单个分区或多个分区中读取消息。 该阅读器将消息偏移量存储在ExecutionContext中以支持重新启动。 KafkaItemWriter使用Spring的Apache Kafka项目中的KafkaTemplate将消息发送到给定主题。

我要感谢Mathieu Ouellet为在Spring Batch中增加对Apache Kafka的支持所做的杰出贡献!
反馈

Spring Boot 4.2.0.M3可以使用Spring Batch 4.2.0.M2。 我们期待听到您对第二个里程碑的反馈! 随时在Twitter上ping @michaelminella或@_benas_或在StackOverflow或Gitter上提问。 如果发现任何问题,请在吉拉(Jira)打开票。

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/10 16:12:17

Android中AGP与Gradle、AS、JDK的版本关系

文章目录1. AGP版本所要求的Gradle、JDK、SDK Build Tools 最小版本2. Android Studio所要求的AGP版本范围在 Android 工程中很多新手经常会因为 gradle、gradle 插件、JDK 等版本不匹配问题导致工程编译报错&#xff0c;却又不知原因为何。 本文给出了包括所用 Android Studi…

作者头像 李华
网站建设 2026/6/10 16:07:13

Reloaded-II贡献指南:如何为开源游戏模组框架做出贡献

Reloaded-II贡献指南&#xff1a;如何为开源游戏模组框架做出贡献 【免费下载链接】Reloaded-II Universal .NET Core Powered Modding Framework for any Native Game X86, X64. 项目地址: https://gitcode.com/gh_mirrors/re/Reloaded-II Reloaded-II是一个强大的开源…

作者头像 李华
网站建设 2026/6/10 16:03:04

Orz压缩工具源码解析:从main.rs到lib.rs的完整流程

Orz压缩工具源码解析&#xff1a;从main.rs到lib.rs的完整流程 【免费下载链接】orz a high performance, general purpose data compressor written in the crab-lang 项目地址: https://gitcode.com/gh_mirrors/or/orz Orz是一款用Rust语言开发的高性能通用数据压缩工…

作者头像 李华