Closed muraliweb9 closed 1 year ago
This looks like this known bug to me:
https://github.com/yidongnan/grpc-spring-boot-starter/issues/633#issuecomment-1564928004
Workaround: Create the GrpcClientBeans in a different @Configuration class and let this config bean @Depend on that new config bean.
Please let me know if this solves the issue for you.
Thanks ST-DDT worked. Implemented as you described.
The GrpcClientBeans @Configuration
@Configuration(value="grpcStubConfig")
@GrpcClientBeans({
@GrpcClientBean(
clazz = RecordsServiceGrpc.RecordsServiceBlockingStub.class,
beanName = "recordsServiceBlockingStub",
client = @GrpcClient("car-records-app"))
})
class GrpcStubConfig {
}
The @DependsOn
configuration @Configuration
@Configuration
@DependsOn("grpcStubConfig")
class GrpcStubConfig2 {
@Bean
public FinaliseBooking finaliseBooking(
@Autowired ZeebeClientWrapper zeebeClient,
@Autowired DiscoveryClient discoveryClient,
@Autowired RecordsServiceGrpc.RecordsServiceBlockingStub stub) {
return new FinaliseBooking(zeebeClient, discoveryClient, stub);
}
}
Thanks for letting me know. I will close this issue and use the other issue for tracking/updates.
Unable to initialise context
Initialise the context
Unable to initialise the Context
What's the problem? What's not working? What's missing and why do you need it?
The application's environment
Which versions do you use?
Bean configuration:
spring factories workaround is added.
application.yml
I have Consul running on localhost:8500 with a service named car-records-app registered to it.
From documentation https://yidongnan.github.io/grpc-spring-boot-starter/en/client/configuration.html I am thinking maybe I am missing a trick with the stub factory.