grpc-ecosystem / grpc-spring

Spring Boot starter module for gRPC framework.
https://grpc-ecosystem.github.io/grpc-spring/
Apache License 2.0
3.48k stars 812 forks source link

有人在SpringBoot 3.0以上版本JDK17 的项目里用这个start吗?需要做哪些改造 #946

Closed wjswk closed 11 months ago

wjswk commented 1 year ago

SpringBoot3.0 JDK17 需要改造什么。

wuaoya commented 1 year ago

版本问题很大,starter还没有支持到那一版,只能说这个组件对版本依赖挺强的

Taogang00 commented 1 year ago

springboot3 自动注册的机制有变化,所以需要手动添加注册,新建以下类应该就能解决问题:

@Configuration @ImportAutoConfiguration({ net.devh.boot.grpc.client.autoconfigure.GrpcClientAutoConfiguration.class, net.devh.boot.grpc.client.autoconfigure.GrpcClientMetricAutoConfiguration.class, net.devh.boot.grpc.client.autoconfigure.GrpcClientHealthAutoConfiguration.class, net.devh.boot.grpc.client.autoconfigure.GrpcClientSecurityAutoConfiguration.class, net.devh.boot.grpc.client.autoconfigure.GrpcClientTraceAutoConfiguration.class, net.devh.boot.grpc.client.autoconfigure.GrpcDiscoveryClientAutoConfiguration.class, net.devh.boot.grpc.common.autoconfigure.GrpcCommonCodecAutoConfiguration.class, net.devh.boot.grpc.common.autoconfigure.GrpcCommonTraceAutoConfiguration.class }) public class GrpcClientConfig { }

yidongnan commented 11 months ago

v2.15.0 is compatible with Spring Boot 3.0 and JAVA 17