New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support to Spring 6 #778
Comments
We got a PR for the new auto config files used in Spring Boot 3 #775. As for AOT integration it is tracked here: https://github.com/yidongnan/grpc-spring-boot-starter/issues/577 |
The change in #775 works for me. AOT also works fine, but there's a missing hint for netty (I will try and get it added to the metadata catalog) and you have to use the non-shaded grpc jars. Sample here: https://github.com/dsyer/native-grpc. |
Hello @dsyer and @ST-DDT tks for your responses! With both yours examples i was able to make the server works (even with the netty-shaddy... not too much trouble with that), but the clients annotated with @GrpcClient(value="xpto") is always null... Maybe you guys have a example of the client too? (I put all autoconfiguration on the imports file likme ST-DDT point) |
If anyone need it too, for make netty-shaded works, i only need to put this dependency com.google.cloud:native-image-suporte:0.14.1 on pom and set the build args with: --initialize-at-run-time=io.grpc.netty.shaded.io.netty.internal.tcnative.CertificateCompressionAlgo |
There is a client in the test in my PR: oracle/graalvm-reachability-metadata#148 (see metadata/io.grpc/grpc-netty/1.51.0/reflect-config.json). |
Tks for the example @dsyer, but saddly this is not enough... The problem is that all attribute annotated with @GrpcClient is always null. Debbuing the GrpcClientBeanPostProcessor class, i notice that the field was never there. Example: In a class ContratosClienteClient: The method GrpcClientBeanPostProcessor.processFields only bring me the "mapper" attribute... Looking in the reflect-config.json that the spring generate, we have this:
So, to be abble to make this works i was obligated to create another config: This work around is really simple in the end, but probably only the autoconfiguration put in .imports is not enough for spring boot 3.0 AOT. This problem doens't happen in JIT formatt, only in AOT. @ST-DDT FYK. |
Yeah, I know. I hope that I can convince (and potentially PR) protobuf/grpc to generate the required configs automatically for their part, so we only have to check our parts here. |
There is one more incompatibility with Spring 6SocketUtils class has been removed from Spring 6 (spring-projects/spring-framework#28054) which is still used in net.devh.boot.grpc.server.config.GrpcServerProperties class. Is there any plans to replace SocketUtils? |
I would open a separate issue about that if I were you. |
Any ETA on support for Spring 6? |
It works pretty well already actually, but those issues I mentioned above would need to be addressed to bring absolutely everything up to date. |
I can confirm, it basically works with some minor issues. |
Can some of you point me to an example of application based on Spring Boot 3 using the grpc-spring-boot-starter (2.14.0.RELEASE)? |
There's a small sample in my fork: https://github.com/dsyer/grpc-spring-boot-starter/tree/springboot3. Also a standalone one at https://github.com/dsyer/native-grpc (linked to above in a comment already). |
@SilviyaPBrayanova I suggest you look and test everything that was said in this topic, the @dsyer examples really work in very simple scenarios, depending on what you are doing there, some other configurations will be necessary... But nothing that is not simple to do. |
After adding |
Did you copy the |
For me, it started to work after adding |
AutoConfiguration.imports
The init method in GrpcMetadataNacosConfiguration, which is not executed when the service is started
@dsyer Later, I will write the address of the project here |
Try adding For me with Spring Boot 3.1.2 the ConfigurationPropeties of |
I don't have any of those problems. Spring will happily call the legacy |
In November we will have the release of spring framework 6.0 and Boot 3.0, both with AOT integrated. Would be very nice to have support for this new version.
The text was updated successfully, but these errors were encountered: