Allow @GRpcService on @Bean factory methods
See original GitHub issueI wonder if it’s high effort to implement such feature
For example we use a mix of dependency-injection approaches/recommendations, as the result, we already have a factory that produces GrpcServices. Would be nice if we could reuse everywhere and make sure that our tests use the same code/config as prod code
@GRpcService
@Bean
public MyGrpcService myGrpcService(ApplicationFactory factory) {
factory.getMyGrpcService()
}
Issue Analytics
- State:
- Created 2 years ago
- Comments:8
Top Results From Across the Web
Allow GrpcService on @Bean methods · Issue #406 - GitHub
The problem GrpcService is only applicable to types. The solution Allow GrpcService on methods, so that it can be used in @Configuration ...
Read more >Configuration | grpc-spring-boot-starter - GitHub Pages
The grpc client configurer allows you to add your custom configuration to grpc's ManagedChannelBuilder s. @Bean public GrpcChannelConfigurer ...
Read more >Creating Spring Beans Through Factory Methods - Baeldung
In this tutorial, we will delve into creating Spring beans using both instance and static factory methods. 2. Instance Factory Method.
Read more >Chapter 3. Beans, BeanFactory and the ApplicationContext
(the type of the returned bean from the static factory method may be the ... When a bean property is a Java Class...
Read more >Implementing a gRPC Service - Quarkus
gRPC service implementations exposed as CDI beans are automatically registered ... If you don't want to implement a service method just throw an...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jvmlet within this code https://github.com/LogNet/grpc-spring-boot-starter/blob/19fc75177a40d5b7b64cf6dcde81dfd4bb9a5eb9/grpc-spring-boot-starter/src/main/java/org/lognet/springboot/grpc/autoconfigure/OnMissingErrorHandlerCondition.java#L29 we are using
getBeanClassName
which does not work on@Bean
factory methods. I will raise a pull request to fix this now.With SB 2.5.x this should work OOTB. Will try to confirm tomorrow