返回首页

对比阅读

对比阅读:Spring Welds AI Into Java's Foundation — 9 Breaking Changes 与 Spring 把 AI 焊成 Java 底层 — 9 个破坏性变更

AEN
Spring AIJavaSpring Boot·

Spring Welds AI Into Java's Foundation — 9 Breaking Changes

On June 12, 2026, Spring AI 2.0 shipped with nine breaking changes in a single release — the baseline jumps from Spring Boot 3 to Boot 4, the JSON library moves from Jackson 2 to Jackson 3, and the officially recommended API entry point shifts from ChatModel to ChatClient. For every Java project currently on Spring AI, this upgrade isn't a smooth transition — it's a foundation swap.

What This Is

Spring is the "ground floor" framework Java has relied on for twenty years. Nearly every bank, telecom carrier, and government core system in China runs on it. Spring AI is its submodule aimed at the large-model era, and 2.0 is the first time it places AI squarely in the "infrastructure" seat.The official upgrade docs say it plainly: no longer aiming to be "glue between model vendors," but rather the JDBC of the AI era (the unified database-connection standard that lets any Java program talk to different databases through one interface) — making AI capability as casually callable as a database. MCP (Model Context Protocol, the standard for letting AI models invoke external tools and data) has also been folded entirely under the Spring banner.The concrete changes include: a baseline version jump (Boot 4, Framework 7, Jackson 3), immutable Builder pattern for Options, ChatClient replacing ChatModel, tool-calling loops moving from inside the model up into the Advisor chain, an MCP ecosystem overhaul, conversation memory refactoring, and refinements to temperature, JSON Schema, and observability metrics.

Industry View

The optimists call this inevitable. The Spring team states outright in the upgrade docs that "ChatClient is the only recommended entry point" — that "one-way-out" posture signals they want the ecosystem to converge around a unified abstraction, not let every model SDK do its own thing. For Java teams long tormented by fragmented AI interfaces, that's actually a relief.But the sober camp flags three risks. First, the synchronized Boot 3 → 4 plus Jackson 2 → 3 jump means legacy third-party libraries like MyBatis and ShardingSphere will get stuck in adaptation limbo — real-world upgrade cycles for existing projects could drag to 12–18 months. Second, moving the tool-calling loop out of the model and up into the Advisor chain gives the application layer more control, but debugging and observability costs rise in lockstep. Third, the "AI-native runtime" vision is appealing, but only if this abstraction can hold up against the underlying models' roughly three-month cadence of paradigm shifts — and historically, the Java ecosystem hasn't always won when facing fast-moving technology.

Impact on Regular People

- For enterprise IT: legacy Java-stack systems — bank cores, ERP, government platforms — can no longer dodge the question of "should we integrate AI?" This upgrade means the long-term cost of not integrating AI keeps climbing.- For individual careers: the hiring profile of Java engineers is being rewritten. "Can you call a large-model API" shifts from a bonus to a default. Understanding AI-engineering concepts like MCP and Advisor will weigh more on your next salary than grinding algorithm problems.- For consumer markets: the bank apps, medical-insurance queries, and carrier customer-service bots on your phone will, over the next two years, almost certainly see their experience upgrades flow from this foundation rebuild — AI chat and smart form-filling will become more common, but it also means personal data will be queried by models at significantly higher frequency.
来源: juejin.cn
BZH
Spring AIJavaSpring Boot·

Spring 把 AI 焊成 Java 底层 — 9 个破坏性变更

2026 年 6 月 12 日,Spring AI 2.0 正式发布,一次性放出 9 个破坏性变更——底层从 Spring Boot 3 跳到 Boot 4,JSON 库从 Jackson 2 换成 Jackson 3,官方唯一推荐的 API 入口从 ChatModel 换成 ChatClient。对所有正在用 Spring AI 的 Java 项目来说,这次升级不是平滑过渡,而是「换了一次底子」。

这是什么

Spring 是 Java 圈用了二十年的「地基」框架,中国几乎所有银行、运营商、政府的核心系统都跑在它上面。Spring AI 是它面向大模型时代的子模块,2.0 是它第一次把 AI 摆到「基础设施」的位置。 这次升级的官方原话是:不再想做「对接各家模型的胶水层」,而要做 AI 时代的 JDBC(数据库连接统一标准,让任何 Java 程序能用同一套接口访问不同数据库)——让 AI 能力像数据库一样成为应用随手可调的能力。MCP(Model Context Protocol,让 AI 模型调用外部工具和数据的标准协议)也被整体收编到 Spring 名下。 具体改动包括:基线大跳版(Boot 4、Framework 7、Jackson 3)、Options 不可变 Builder 化、ChatClient 取代 ChatModel、工具调用循环从模型内部上移到 Advisor 链、MCP 生态换血、对话记忆重构,以及温度、JSON Schema、观测指标等细节。

行业怎么看

乐观派认为这是必然选择。Spring 团队在升级文档里明确表态「ChatClient 是唯一推荐入口」——这种「只留一条路」的姿态,说明他们想让生态围绕统一抽象收敛,而不是任由各家模型 SDK 各搞一套。对长期被碎片化 AI 接口折磨的 Java 团队来说,这反而是好事。 但冷静派指出三个风险。第一,Boot 3 → 4 加 Jackson 2 → 3 的同步升级,意味着 MyBatis、ShardingSphere 等老牌第三方库会卡在适配期,存量项目实际升级周期可能拖到 12-18 个月。第二,把工具调用循环从模型内部上移到 Advisor 链虽给了应用层更多控制权,但调试和观测成本同步上升。第三,「AI 原生运行时」的愿景很美好,前提是这套抽象能扛住底层模型每三个月一次的范式更迭——历史上 Java 生态在快速演进的技术面前并不总是赢家。

对普通人的影响

- 对企业 IT:Java 技术栈的存量系统——银行核心、ERP、政务平台——再难回避「要不要集成 AI」的问题;这次升级意味着不集成 AI 的长期成本会越来越高。 - 对个人职场:Java 工程师的招聘画像正在改写,「会调大模型 API」从加分项变成默认项;理解 MCP、Advisor 这类 AI 工程化概念,会比单纯刷算法题更直接影响下一份工作的薪资。 - 对消费市场:你手机里用的银行 App、医保查询、运营商客服,未来两年的体验升级大概率来自这次底层重构——AI 对话、智能填单会更普及,但也意味着个人数据被模型调用的频率会显著上升。
来源: juejin.cn