0

I'm trying to develop a custom DiscoveryClient but when it uses lb:// it doesn't work correctly. I have instatiated a DiscoveryClientServiceInstanceListSupplier using @Import(LoadBalancerClientConfiguration.class) in the application class.

Looking through the code there is notion of

this.serviceId = environment.getProperty(PROPERTY_NAME);

but whenver I debug it, I get null for that value.

spencergibb
  • 24,471
  • 6
  • 69
  • 75
Archimedes Trajano
  • 35,625
  • 19
  • 175
  • 265
  • Why did you instantiate one of those on your own? Can you show your bean declarations? – spencergibb Apr 19 '22 at 06:24
  • It took a while but I can't seem to find the documentation around this... adding @LoadBalancerClients(defaultConfiguration = LoadBalancerClientConfiguration.class) got the DiscoveryClientServiceInstanceListSupplier instantiated and worked correctly as a load balancer. – Archimedes Trajano Apr 19 '22 at 07:38
  • Going to delete this post rather than repurposing it. The real question would be how do I enable `DiscoveryClient` that provides URLs to work with Spring-Cloud Load Balancer In the end it's that lat comment I had but couldn't find anywhere in the documentation where it was. – Archimedes Trajano Apr 19 '22 at 18:33

0 Answers0