-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning log when using AnnotationEnhancer #3467
Comments
@RuslanHryn Thanks for the report. We will look at this. Please go ahead and provide a sample as that would speed things up. |
@sobychacko thanks! forgot to mention that I'm able to reproduce this issue on Spring Boot 3.2 and 3.3 |
I think you mean this doc since there is no mentioning of the Do you have that your |
@artembilan Sorry, fixed the link in the description.
yes, it is static |
Yeah... According to my testing that |
…` for early BF access Fixes: spring-projects#3467 The `KafkaListenerAnnotationBeanPostProcessor.afterPropertiesSet()` get access to `BeanFactory` for other beans which causes a warning into logs like: ``` 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 ``` The rule of thumb is to not have any bean factory access from `BeanPostProcessor` initialization phase * Fix `KafkaListenerAnnotationBeanPostProcessor` to `buildEnhancer()` i lazy manner. Therefore remove an `afterPropertiesSet()` altogether **Auto-cherry-pick to `3.2.x` & `3.1.x`**
…access (#3468) Fixes: #3467 #3467 The `KafkaListenerAnnotationBeanPostProcessor.afterPropertiesSet()` gets access to `BeanFactory` for other beans which causes a warning into logs like: ``` 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 ``` The rule of thumb is not to have any bean factory access from `BeanPostProcessor` initialization phase. * Fix `KafkaListenerAnnotationBeanPostProcessor` to `buildEnhancer()` in lazy manner. Therefore remove an `afterPropertiesSet()` altogether. (cherry picked from commit 4a135a1)
…access (#3468) Fixes: #3467 #3467 The `KafkaListenerAnnotationBeanPostProcessor.afterPropertiesSet()` gets access to `BeanFactory` for other beans which causes a warning into logs like: ``` 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 ``` The rule of thumb is not to have any bean factory access from `BeanPostProcessor` initialization phase. * Fix `KafkaListenerAnnotationBeanPostProcessor` to `buildEnhancer()` in lazy manner. Therefore remove an `afterPropertiesSet()` altogether. (cherry picked from commit 4a135a1)
In what version(s) of Spring for Apache Kafka are you seeing this issue?
in the latest version 3.2.3
Describe the bug
There is the following warning log when using AnnotationEnhancer at the start of the app:
trationDelegate$BeanPostProcessorChecker : Bean 'groupIdEnhancer' of type [org.example.springkafkaenhancerreproducer.EnhancerConfiguration$$Lambda/0x0000000800332650] 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 [org.springframework.kafka.config.internalKafkaListenerAnnotationProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
As I know this warning means that BeanPostProcessor uses
internalKafkaListenerAnnotationProcessor
and Spring had to createinternalKafkaListenerAnnotationProcessor
before the BeanPostProcessor. That's why, internalKafkaListenerAnnotationProcessor can't be processed by the BeanPostProcessor.Therefore, it should not cause any issues, but eliminating this warning would be nice.
To Reproduce
AnnotationEnhancer
as described here https://docs.spring.io/spring-kafka/reference/kafka/receiving-messages/kafkalistener-attrs.htmltrationDelegate$BeanPostProcessorChecker : Bean 'groupIdEnhancer' of type [org.example.springkafkaenhancerreproducer.EnhancerConfiguration$$Lambda/0x0000000800332650] 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 [org.springframework.kafka.config.internalKafkaListenerAnnotationProcessor]? Check the corresponding BeanPostProcessor declaration and its dependencies.
Expected behavior
No warning messages in the logs when using
AnnotationEnhancer
Sample
I can provide if needed but it should be very easy to reproduce
The text was updated successfully, but these errors were encountered: