Spring Cloud 2025.0.0
Spring Cloud 2025.0.0 "Northfields" 于 2025年5月29日正式发布,完全兼容 Spring Boot 3.5.0。本版本在微服务架构的多个核心组件上进行了重要改进和功能增强。
版本兼容性
-
Spring Boot: 3.5.0
-
发布代号: Northfields (按字母顺序命名传统)
-
主要变更: 包含破坏性变更,不支持平滑升级,细节请看这篇文章
Spring Cloud Gateway 重大更新
新增功能
1. Function & Stream 处理器集成
Gateway 现在原生支持 spring-cloud-function
和 spring-cloud-stream
处理器:
spring: cloud: gateway: routes: -id:function-route uri:function://myFunction predicates: -Path=/api/process/** -id:stream-route uri:stream://myStreamProcessor predicates: - Path=/api/stream/**
技术优势:
-
支持函数式编程模型处理请求
-
集成消息驱动架构 (Kafka, RabbitMQ)
-
简化 Serverless 和事件驱动架构实现
2. Bucket4j 限流器支持
WebFlux 版本新增 Bucket4j 令牌桶算法支持:
spring: cloud: gateway: server: webflux: routes: -id:rate-limited-route uri:http://backend-service filters: -name:Bucket4jRateLimit args: capacity:100 refill-rate:10 refill-period: PT1S
重要弃用
1. WebClientRouting 基础设施
-
状态: 已弃用,5.0 版本将移除
-
影响: 依赖此基础设施的路由逻辑需要迁移
-
建议: 使用 Gateway 提供的标准路由机制
2. 模块和启动器重命名
为明确区分 Web 技术栈和工作模式,引入新的命名规范:
旧名称 | 新名称 | 说明 |
spring-cloud-gateway-server | spring-cloud-gateway-server-webflux | WebFlux 服务器模式 |
spring-cloud-gateway-server-mvc | spring-cloud-gateway-server-webmvc | WebMVC 服务器模式 |
spring-cloud-starter-gateway-server | spring-cloud-starter-gateway-server-webflux | WebFlux 启动器 |
spring-cloud-starter-gateway-server-mvc | spring-cloud-starter-gateway-server-webmvc | WebMVC 启动器 |
spring-cloud-gateway-mvc | spring-cloud-gateway-proxyexchange-webmvc | WebMVC 代理交换 |
spring-cloud-gateway-webflux | spring-cloud-gateway-proxyexchange-webflux | WebFlux 代理交换 |
破坏性变更
X-Forwarded-* 头部默认禁用
出于安全考虑,X-Forwarded-* 和 Forwarded 头部功能默认禁用。
配置受信任代理:
# WebFlux 版本 spring: cloud: gateway: server: webflux: trusted-proxies:"192\\.168\\..*|10\\..*" # WebMVC 版本 (4.1.x+) spring: cloud: gateway: mvc: trusted-proxies: "192\\.168\\..*|10\\..*"
安全影响: 防止恶意伪造代理头部,需要显式配置信任边界。但如果下游业务有依赖此请求头,请及时处理。
Spring Cloud Config 增强
AWS S3 YAML Profile 支持
Config Server 现在支持从 S3 读取 profile 特定的 YAML 文件:
spring: cloud: config: server: awss3: bucket: my-config-bucket region: us-west-2
文件结构示例:
s3://my-config-bucket/ ├── application.yaml ├── application-dev.yaml ├── application-prod.yaml └── application-test.yaml
Config Server 将根据激活的 profile 自动加载对应配置文件。
Spring Cloud Kubernetes 更新
组合配置源支持
Kubernetes ConfigMap 和 Secret 现在可作为组合配置源:
spring: cloud: kubernetes: config: sources: -name:app-config namespace:default -name:db-secret namespace:default explicit-prefix: database
配置优先级:
1. 命令行参数
2. 系统属性
3. Kubernetes ConfigMap/Secret
4. application.yaml
5. 默认值
Spring Cloud Circuitbreaker 新特性
响应式隔离支持
新增对响应式编程模式支持:
@Component publicclassReactiveService { @Autowired private ReactiveCircuitBreakerFactory circuitBreakerFactory; public Mono<String> callExternalService() { return circuitBreakerFactory .create("external-service") .run( webClient.get().uri("/api/data").retrieve().bodyToMono(String.class), throwable -> Mono.just("fallback-response") ); } }
配置示例:
resilience4j: bulkhead: instances: external-service: max-concurrent-calls: 10 max-wait-duration: 1000ms
Spring Cloud Netflix 改进
Eureka 客户端增强
支持 Apache HTTP Client 5 的 RequestConfig 定制:
@Bean public EurekaClientHttpRequestFactorySupplier customRequestFactorySupplier() { return () -> { RequestConfigrequestConfig= RequestConfig.custom() .setConnectTimeout(5000) .setSocketTimeout(10000) .setConnectionRequestTimeout(3000) .build(); returnnewHttpComponentsClientHttpRequestFactory( HttpClients.custom() .setDefaultRequestConfig(requestConfig) .build() ); }; }
版本更新清单
所有模块已更新至最新版本以确保与 Spring Boot 3.5.0 兼容:
模块名称 | 版本 |
Spring Cloud Config | 4.3.0 |
Spring Cloud Gateway | 4.3.0 |
Spring Cloud Kubernetes | 3.3.0 |
Spring Cloud Circuitbreaker | 3.3.0 |
Spring Cloud Netflix | 4.3.0 |
Spring Cloud Build | 4.3.0 |
Spring Cloud Openfeign | 4.3.0 |
Spring Cloud Stream | 4.3.0 |
Spring Cloud Commons | 4.3.0 |
Spring Cloud Contract | 4.3.0 |
Spring Cloud Consul | 4.3.0 |
Spring Cloud Vault | 4.3.0 |
Spring Cloud Function | 4.3.0 |
Spring Cloud Bus | 4.3.0 |
Spring Cloud Zookeeper | 4.3.0 |
Spring Cloud Task | 3.3.0 |
Spring Cloud Starter Build | 2025.0.0 |
升级指南
前置条件
-
1. 升级 Spring Boot 至 3.5.0
-
2. Java 版本: 确保使用 Java 17+
升级步骤
1. 更新 BOM 版本
<dependencyManagement> <dependencies> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-dependencies</artifactId> <version>2025.0.0</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement>
2. Gateway 模块迁移
<!-- 旧依赖 --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-gateway</artifactId> </dependency> <!-- 新依赖 --> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-gateway-server-webflux</artifactId> </dependency>
3. 配置属性迁移
# 旧配置 spring: cloud: gateway: routes: -id:example uri:http://example.com # 新配置 spring: cloud: gateway: server: webflux: routes: -id:example uri: http://example.com
4. 安全配置更新
spring: cloud: gateway: server: webflux: trusted-proxies: "10\\..*|192\\.168\\..*"
5. Spring Cloud Alibaba 兼容性注意事项
如果您的项目集成了 Spring Cloud Alibaba 组件,需特别注意 Spring Cloud 2025.0.0 与 Spring Cloud Alibaba 2023.0.3 版本之间存在日志依赖冲突问题,可能导致应用启动失败。

低调大师中文资讯倾力打造互联网数据资讯、行业资源、电子商务、移动互联网、网络营销平台。
持续更新报道IT业界、互联网、市场资讯、驱动更新,是最及时权威的产业资讯及硬件资讯报道平台。
转载内容版权归作者及来源网站所有,本站原创内容转载请注明来源。
- 上一篇
Warm-Flow 发布 1.7.3 端午节(设计器流和流程图大升级)
Warm-Flow发布1.7.3 端午节(设计器流和流程图大升级) 更新内容 [feat] 新版流程图通过前端渲染 [perf] 美化流程设计器ui [feat] 办理人权限处理器,新增办理人转换接口,比如角色转用户 [update] 优化报错提醒 [update] 添加Version适配当前设计器的行为 [update] 组件内置访问请求/warm-flow-ui/token-name改成/warm-flow-ui/config 新版设计器 新版流程图 项目介绍 Dromara Warm-Flow国产工作流引擎,其特点简洁轻量,五脏俱全,灵活扩展性强,是一个可通过jar引入设计器的工作流。 支持常见审批功能、监听器与流程变量、条件表达式、办理人表达式 自带流程图、流程设计器、节点扩展属性 支持常见的orm框架 支持不同的数据库 生态丰富可扩展,文档全面 功能思维导图 演示地址 http://www.hhzai.top 账号密码:admin/admin123 官网 https://warm-flow.dromara.org Warm-Flow视频 Warm-Flow初体验
- 下一篇
DeepSeek-R1-0528 更新:思考更深,推理更强
本文转载自:DeepSeek-R1 更新,思考更深,推理更强 DeepSeek R1 模型已完成小版本升级,当前版本为 DeepSeek-R1-0528。用户通过官方网站、APP 或小程序进入对话界面后,开启“深度思考”功能即可体验最新版本。API 也已同步更新,调用方式不变。 深度思考能力强化 DeepSeek-R1-0528 仍然使用 2024 年 12 月所发布的 DeepSeek V3 Base 模型作为基座,但在后训练过程中投入了更多算力,显著提升了模型的思维深度与推理能力。 更新后的 R1 模型在数学、编程与通用逻辑等多个基准测评中取得了当前国内所有模型中首屈一指的优异成绩,并且在整体表现上已接近其他国际顶尖模型,如 o3 与 Gemini-2.5-Pro。 DeepSeek-R1-0528 在各项评测集上均取得了优异表现(基准测试使用 64K 输出长度;在 Humanity's Last Exam 中,只使用其中的文本题目进行测试) 相较于旧版 R1,新版模型在复杂推理任务中的表现有了显著提升。例如在 AIME 2025 测试中,新版模型准确率由旧版的 70% 提升至 8...
相关文章
文章评论
共有0条评论来说两句吧...
文章二维码
点击排行
推荐阅读
最新文章
- CentOS7设置SWAP分区,小内存服务器的救世主
- Mario游戏-低调大师作品
- Docker使用Oracle官方镜像安装(12C,18C,19C)
- 2048小游戏-低调大师作品
- Jdk安装(Linux,MacOS,Windows),包含三大操作系统的最全安装
- MySQL8.0.19开启GTID主从同步CentOS8
- CentOS8安装Docker,最新的服务器搭配容器使用
- CentOS8安装MyCat,轻松搞定数据库的读写分离、垂直分库、水平分库
- CentOS7编译安装Cmake3.16.3,解决mysql等软件编译问题
- CentOS7,CentOS8安装Elasticsearch6.8.6