spring-cloud-alibaba icon indicating copy to clipboard operation
spring-cloud-alibaba copied to clipboard

Feature/spring7.x

Open chiangzeon opened this issue 3 weeks ago • 26 comments

Describe what this PR does / why we need it

spring7.x与springboot4.x已推出,现有依赖未适配上述框架

Does this pull request fix one issue?

Describe how you did it

1、修改pom版本依赖,主要见project root path的pom.xml 2、升级spring、springboot、junit版本 3、特殊依赖,如gateway、health、jdbc等做了额外显示声明 4、新版本废弃代码已修复,如健康检测,对象序列化与反序列化,服务注册。以及其他class路径变更后修改 5、部分单测内容变更实现,如TestRestTemplate在新版本中已不存在,采用RestTestClient,语义保持不变

Describe how to verify it

1、完全遵照社区指南code style格式化 2、mvn clean install 全部module可正常编译

Special notes for reviews

spring7发布已半月余,从中央仓库获取nacos已实现最新接口,但spring.factories文件中依然是废弃版本,应用无法启动。业务又迫切需要spring7的新特性,如虚拟线程,web版本戳等,TTS、ASR业务最迫切。所以自己动手修改,目前本地install版本可正常使用,希望采纳

chiangzeon avatar Dec 02 '25 09:12 chiangzeon

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Dec 02 '25 09:12 CLAassistant

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

chiangzeon avatar Dec 02 '25 09:12 chiangzeon

CLA assistant check Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.You have signed the CLA already but the status is still pending? Let us recheck it.

chiangzeon avatar Dec 02 '25 09:12 chiangzeon

This pull request is still a work in progress

I signed it just now

chiangzeon avatar Dec 02 '25 09:12 chiangzeon

✨ support spring-boot 4.0.0、spring-cloud 2025.1.0

@chiangzeon 请查看此 PR

请问需要我做什么

chiangzeon avatar Dec 02 '25 10:12 chiangzeon

✨ support spring-boot 4.0.0、spring-cloud 2025.1.0 @chiangzeon 请查看此 PR

请问需要我做什么

已经完成了,现在待审核,着急的话可以用我构建好的 https://gitlab.xuxiaowei.com.cn/xuxiaowei-com-cn/spring-cloud-alibaba/

xuxiaowei-com-cn avatar Dec 02 '25 10:12 xuxiaowei-com-cn

✨ support spring-boot 4.0.0、spring-cloud 2025.1.0 @chiangzeon 请查看此 PR

请问需要我做什么

已经完成了,现在待审核,着急的话可以用我构建好的 https://gitlab.xuxiaowei.com.cn/xuxiaowei-com-cn/spring-cloud-alibaba/

额,是已经有支持版本了是么?哎呀,白忙活了

chiangzeon avatar Dec 02 '25 10:12 chiangzeon

✨ support spring-boot 4.0.0、spring-cloud 2025.1.0 @chiangzeon 请查看此 PR

请问需要我做什么

已经完成了,现在待审核,着急的话可以用我构建好的 https://gitlab.xuxiaowei.com.cn/xuxiaowei-com-cn/spring-cloud-alibaba/

额,是已经有支持版本了是么?哎呀,白忙活了

不白忙活,涨经验了

xuxiaowei-com-cn avatar Dec 02 '25 10:12 xuxiaowei-com-cn

✨ support spring-boot 4.0.0、spring-cloud 2025.1.0 @chiangzeon 请查看此 PR

请问需要我做什么

已经完成了,现在待审核,着急的话可以用我构建好的 https://gitlab.xuxiaowei.com.cn/xuxiaowei-com-cn/spring-cloud-alibaba/

额,是已经有支持版本了是么?哎呀,白忙活了

不白忙活,涨经验了

我看到后续的集成测试一直未处理,是因为有类似的PR,所以当前PR就被废弃了还是什么

chiangzeon avatar Dec 03 '25 02:12 chiangzeon

✨ support spring-boot 4.0.0、spring-cloud 2025.1.0 @chiangzeon 请查看此 PR

请问需要我做什么

已经完成了,现在待审核,着急的话可以用我构建好的 https://gitlab.xuxiaowei.com.cn/xuxiaowei-com-cn/spring-cloud-alibaba/

额,是已经有支持版本了是么?哎呀,白忙活了

不白忙活,涨经验了

我看到后续的集成测试一直未处理,是因为有类似的PR,所以当前PR就被废弃了还是什么

此 PR 很多地方没有做,比如继承、使用的依赖版本等等,并不符合升级 Spring Boot 4.0.0、Spring Cloud 2025.1.0

xuxiaowei-com-cn avatar Dec 03 '25 02:12 xuxiaowei-com-cn

✨ support spring-boot 4.0.0、spring-cloud 2025.1.0 @chiangzeon 请查看此 PR

请问需要我做什么

已经完成了,现在待审核,着急的话可以用我构建好的 https://gitlab.xuxiaowei.com.cn/xuxiaowei-com-cn/spring-cloud-alibaba/

额,是已经有支持版本了是么?哎呀,白忙活了

不白忙活,涨经验了

我看到后续的集成测试一直未处理,是因为有类似的PR,所以当前PR就被废弃了还是什么

此 PR 很多地方没有做,比如继承、使用的依赖版本等等,并不符合升级 Spring Boot 4.0.0、Spring Cloud 2025.1.0

能否举例说明上述问题所在代码块或配置文件,学习下

chiangzeon avatar Dec 03 '25 02:12 chiangzeon

比如 spring-cloud-build 没有升级,

xuxiaowei-com-cn avatar Dec 03 '25 02:12 xuxiaowei-com-cn

比如 spring-cloud-build 没有升级,

学习了,请教下是先前已系统的参阅spring官网获悉的么,这一步我没有处理。

chiangzeon avatar Dec 03 '25 02:12 chiangzeon

个人经验,有兴趣看看这个 【Spring Cloud Alibaba 升级 Spring Boot 4.0.0、Spring Cloud 2025.1.0【直播录像】-哔哩哔哩】 https://b23.tv/VYcBvhf

xuxiaowei-com-cn avatar Dec 03 '25 02:12 xuxiaowei-com-cn

✨ support spring-boot 4.0.0、spring-cloud 2025.1.0 @chiangzeon 请查看此 PR

请问需要我做什么

已经完成了,现在待审核,着急的话可以用我构建好的 https://gitlab.xuxiaowei.com.cn/xuxiaowei-com-cn/spring-cloud-alibaba/

启动应用后,nacos怎么没有去服务端获取配置呢?

kuangyoubo avatar Dec 04 '25 11:12 kuangyoubo

@kuangyoubo https://github.com/alibaba/spring-cloud-alibaba/issues/4098

xuxiaowei-com-cn avatar Dec 04 '25 11:12 xuxiaowei-com-cn

✨ support spring-boot 4.0.0、spring-cloud 2025.1.0 @chiangzeon 请查看此 PR

请问需要我做什么

已经完成了,现在待审核,着急的话可以用我构建好的 https://gitlab.xuxiaowei.com.cn/xuxiaowei-com-cn/spring-cloud-alibaba/

启动应用后,nacos怎么没有去服务端获取配置呢?

@kuangyoubo #4098

我是那么配置的,我故意把地址改了,根本就没有访问,nacos的日志都没有输出一句

kuangyoubo avatar Dec 04 '25 11:12 kuangyoubo

nacos 版本对应吗?

xuxiaowei-com-cn avatar Dec 04 '25 12:12 xuxiaowei-com-cn

> > > > ✨ support spring-boot 4.0.0、spring-cloud 2025.1.0

@chiangzeon 请查看此 PR

请问需要我做什么

已经完成了,现在待审核,着急的话可以用我构建好的 https://gitlab.xuxiaowei.com.cn/xuxiaowei-com-cn/spring-cloud-alibaba/

启动应用后,nacos怎么没有去服务端获取配置呢?

@kuangyoubo #4098

我是那么配置的,我故意把地址改了,根本就没有访问,nacos的日志都没有输出一句

参考这个配置试下

spring:
  threads:
    virtual:
      enabled: true
  main:
    allow-circular-references: true
  application:
    name: your-application-name
  profiles:
    active: ${DEPLOY_ENV:local}
  config:
    import: nacos:${spring.application.name}
  cloud:
    compatibility-verifier:
      enabled: false #冲突检查
    bootstrap:
      enabled: true
    openfeign:
      lazy-attributes-resolution: true
    nacos:
      config:
        server-addr: ${NACOS_ADDR}
        file-extension: properties
        group: YOUR-GROUP
        namespace: ${DEPLOY_ENV}
        access-key: ${NACOS_AK}
        secret-key: ${NACOS_SK}

chiangzeon avatar Dec 04 '25 12:12 chiangzeon

1c514b83-ce16-42be-af0f-172d1ce6ac85

这种单纯的springboot应用,我这样配置是可以获取到配置文件的,nacos服务端的版本是 2.3.0

image 这种配置就不行了,服务端都没有访问了

kuangyoubo avatar Dec 04 '25 12:12 kuangyoubo

> > > > ✨ support spring-boot 4.0.0、spring-cloud 2025.1.0

@chiangzeon 请查看此 PR

请问需要我做什么

已经完成了,现在待审核,着急的话可以用我构建好的 https://gitlab.xuxiaowei.com.cn/xuxiaowei-com-cn/spring-cloud-alibaba/

启动应用后,nacos怎么没有去服务端获取配置呢?

@kuangyoubo #4098

我是那么配置的,我故意把地址改了,根本就没有访问,nacos的日志都没有输出一句

参考这个配置试下

spring:
  threads:
    virtual:
      enabled: true
  main:
    allow-circular-references: true
  application:
    name: your-application-name
  profiles:
    active: ${DEPLOY_ENV:local}
  config:
    import: nacos:${spring.application.name}
  cloud:
    compatibility-verifier:
      enabled: false #冲突检查
    bootstrap:
      enabled: true
    openfeign:
      lazy-attributes-resolution: true
    nacos:
      config:
        server-addr: ${NACOS_ADDR}
        file-extension: properties
        group: YOUR-GROUP
        namespace: ${DEPLOY_ENV}
        access-key: ${NACOS_AK}
        secret-key: ${NACOS_SK}

补充说明

需引入依赖

<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>

1、当前的配置示例是放在bootstrap.yml中 2、调试com.alibaba.cloud.nacos.configdata.NacosConfigDataLoader#pullConfig获取情况

chiangzeon avatar Dec 04 '25 12:12 chiangzeon

nacos 版本对应吗?

客户端就没有调用服务端,根据日志和错误的地址来确定的

kuangyoubo avatar Dec 04 '25 12:12 kuangyoubo

image

这是我的依赖

kuangyoubo avatar Dec 04 '25 12:12 kuangyoubo

> > > > ✨ support spring-boot 4.0.0、spring-cloud 2025.1.0

@chiangzeon 请查看此 PR

请问需要我做什么

已经完成了,现在待审核,着急的话可以用我构建好的 https://gitlab.xuxiaowei.com.cn/xuxiaowei-com-cn/spring-cloud-alibaba/

启动应用后,nacos怎么没有去服务端获取配置呢?

@kuangyoubo #4098

我是那么配置的,我故意把地址改了,根本就没有访问,nacos的日志都没有输出一句

参考这个配置试下

spring:
  threads:
    virtual:
      enabled: true
  main:
    allow-circular-references: true
  application:
    name: your-application-name
  profiles:
    active: ${DEPLOY_ENV:local}
  config:
    import: nacos:${spring.application.name}
  cloud:
    compatibility-verifier:
      enabled: false #冲突检查
    bootstrap:
      enabled: true
    openfeign:
      lazy-attributes-resolution: true
    nacos:
      config:
        server-addr: ${NACOS_ADDR}
        file-extension: properties
        group: YOUR-GROUP
        namespace: ${DEPLOY_ENV}
        access-key: ${NACOS_AK}
        secret-key: ${NACOS_SK}

补充说明

需引入依赖

<dependency>
	<groupId>org.springframework.cloud</groupId>
	<artifactId>spring-cloud-starter-bootstrap</artifactId>
</dependency>

1、当前的配置示例是放在bootstrap.yml中 2、调试com.alibaba.cloud.nacos.configdata.NacosConfigDataLoader#pullConfig获取情况

com.alibaba.cloud.nacos.configdata.NacosConfigDataLoader#pullConfig 这个方法没有进去

kuangyoubo avatar Dec 04 '25 12:12 kuangyoubo

image 这是我的依赖

能否提供一个源码最小样本,另上面评论提到的bootstrap依赖是否引入,以及断点调试的截图能否一并提供

chiangzeon avatar Dec 04 '25 12:12 chiangzeon

@kaori-seasons 我想问一下,这个 PR 为什么会通过?

  1. Spring Cloud 2025.1.0、Spring Boot 4.0 使用的 gateway 是 spring-cloud-starter-gateway-server-webflux,而这个 PR 使用的是 Spring Cloud 2025.0.0 的 gateway
  2. 升级 Spring Cloud 2025.1.0 时,需要升级 到 org.springframework.cloud:spring-cloud-build:5.0.0
  3. 还有 spring-boot-health 等待依赖,
  4. 你们能不能看一下 Spring Cloud 2025.1.0 的更新后再审核?
  5. 不了解 Spring Cloud 2025.1.0 可以看看视频:Spring Cloud Alibaba 升级 Spring Boot 4.0.0、Spring Cloud 2025.1.0【直播录像】

xuxiaowei-com-cn avatar Dec 16 '25 04:12 xuxiaowei-com-cn

@kaori-seasons 为什么不多想一下?还是压根没看 PR 内容?

image

xuxiaowei-com-cn avatar Dec 16 '25 05:12 xuxiaowei-com-cn