Open mp911de opened 3 years ago
This is also something I need to look into for eureka, consul and zookeeper
Right now, all infrastructure beans are registered in config location resolvers/loaders. Would it make sense to have another type of hook that moves infrastructure bean registration into a dedicated place? Something, that is guaranteed to be activated only once if a configdata resolver instance returns at least one location? Or before the config loader gets activated?
There is another hook. I can write a DiscoveryClientBootstrapper
in spring-cloud-commons (via spring.factories) that puts a DiscoveryClient
in the bootstrap context.
Sorry, not in commons, but in each individual discovery client project. See https://github.com/spring-cloud/spring-cloud-consul/blob/master/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/configclient/ConsulDiscoveryClientConfigServiceBootstrapConfiguration.java for an example
We should detect whether a
DiscoveryClient
is available so we can configure an appropriateVaultEndpointProvider
. We have already support in the boostrap context, but with moving the activation into ConfigData-based activation, we should consider aDiscoveryClient
in the ConfigDataLoader and in our auto-configuration.