Skip to content

SimpleDiscoveryClientAutoConfiguration doesn't use SimpleDiscoveryProperties bean, but direct method call #687

@lightoze

Description

@lightoze

When I attempt to use service discovery from BeanPostProcessor, SimpleDiscoveryClient returns empty instance list. Example code would be:

applicationContext.getBean(CompositeDiscoveryClient.class).getInstances("oidc-server")

While debugging I can see that SimpleDiscoveryClient#getInstances is called before SimpleDiscoveryProperties#init, and during that first call properties are not yet initialized and instance list is empty.

Root cause seems to be SimpleDiscoveryClientAutoConfiguration and proxyBeanMethods = false. Should be trivial to fix with explicit method argument injection.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions