一、背景描述
[mate-uaa:192.168.3.9:20001] 2022-01-22 23:27:52.907 WARN 17966 [] [main] iguration$LoadBalancerCaffeineWarnLogger : Spring Cloud LoadBalancer is currently working with the default cache. You can switch to using Caffeine cache, by adding it and org.springframework.cache.caffeine.CaffeineCacheManager to the classpath.
在微服务引入loadbalancer的包,如下所示:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
默认情况下未做任何设置在启动的时候,就会出现篇首的告警信息。
二、建议优化
2.1 引入Caffeine依赖
<dependency>
<groupId>com.github.ben-manes.caffeine</groupId