Skip to content

Conversation

@artembilan
Copy link
Member

Fixes: #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

…` 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`**
@artembilan artembilan requested a review from sobychacko August 29, 2024 17:16
@sobychacko sobychacko merged commit 4a135a1 into spring-projects:main Aug 29, 2024
spring-builds pushed a commit that referenced this pull request Aug 29, 2024
…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)
spring-builds pushed a commit that referenced this pull request Aug 29, 2024
…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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Warning log when using AnnotationEnhancer

2 participants