Skip to content

Spring Cloud LoadBalancer default cache warning should take discovery client implementation into account #1540

@filpano

Description

@filpano

When using the default cache, the following warning is logged:

Spring Cloud LoadBalancer is currently working with the default cache. You can switch to using Caffeine cache, by adding it to the classpath.

As clarified in the docs via #991, this is unnecessary if using a Service Discovery implementation which itself performs caching, such as EurekaDiscoveryClient.

IMO this is something that the framework can/should take into account. Supressing the warning if a known DiscoveryClient implementation is on the classpath (e.g. via @ConditionalOnClass or even a simple Class lookup).

A user seeing this warning will add e.g. Caffeine as a cache mechanism while potentially then introducing a buggy double-caching layer, unless they carefully read a specific section of the docs and/or are using a caching mechanism that does not contain caching itself (e.g. EurekaDiscoveryClient).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions