spring-cloud / spring-cloud-commons

Common classes used in different Spring Cloud implementations
Apache License 2.0
701 stars 697 forks source link

Spring Cloud Common Warn on lbRestClientPostProcessor #1348

Closed ksloo1788 closed 4 months ago

ksloo1788 commented 4 months ago

Spring Cloud Version: 2023.0.1

Spring Boot Version: 3.2.4

Log 2024-03-31 13:02:07.127 [main] WARN org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization - Bean 'org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration$DeferringLoadBalancerInterceptorConfig' of type [org.springframework.cloud.client.loadbalancer.LoadBalancerAutoConfiguration$DeferringLoadBalancerInterceptorConfig] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). The currently created BeanPostProcessor [lbRestClientPostProcessor] is declared through a non-static factory method on that class; consider declaring it as static instead. 2024-03-31 13:02:07.131 [main] WARN org.springframework.context.support.PostProcessorRegistrationDelegate$BeanPostProcessorChecker.postProcessAfterInitialization - Bean 'deferringLoadBalancerInterceptor' of type [org.springframework.cloud.client.loadbalancer.DeferringLoadBalancerInterceptor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying). Is this bean getting eagerly injected into a currently created BeanPostProcessor [lbRestClientPostProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.

Subrhamanya commented 4 months ago

+1 I am also getting this warning

OlgaMaciaszek commented 4 months ago

It's by design. Boot informs DeferringLoadBalancerInterceptor will not be eligible for auto-proxying, and we don't want it to be.