Skip to content
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

perf: @Bean初始化优化, 以消除日志:is not eligible for getting processed by all BeanPostProcessors #608

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

qxo
Copy link
Contributor

@qxo qxo commented Dec 23, 2023

  1. 由于Advisor会优先初始化,故相关@bean应加: @ROLE(BeanDefinition.ROLE_INFRASTRUCTURE) 以消除:is not eligible for getting processed by all BeanPostProcessors

  2. 去除@EnableConfigurationProperties(DynamicDataSourceProperties.class) 改为static方式配置是为了加@ROLE(BeanDefinition.ROLE_INFRASTRUCTURE)

  3. spring 5.2+ 配置类如不内部不存在@bean方法引用应加: proxyBeanMethods = false 以去除不必要代理类 肖:ie: @Configuration(proxyBeanMethods = false)

此PR是了消除启动时的以下日志:

 [restartedMain] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker[376] - Bean 'spring.datasource.dynamic-com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties' of type [com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
12-23 09:29:16.779 [restartedMain] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker[376] - Bean 'dsProcessor' of type [com.baomidou.dynamic.datasource.processor.DsHeaderProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style
  • Refactor
  • Doc
  • Other, please describe:

The description of the PR:
@bean初始化优化, 以消除日志:is not eligible for getting processed by all BeanPostProcessors

Other information:

…anPostProcessors

1. 由于Advisor会优先初始化,故相关@bean应加: @ROLE(BeanDefinition.ROLE_INFRASTRUCTURE)
以消除:is not eligible for getting processed by all BeanPostProcessors

2. 去除@EnableConfigurationProperties(DynamicDataSourceProperties.class) 改为static方式配置是为了加@ROLE(BeanDefinition.ROLE_INFRASTRUCTURE)

3. spring 5.2+ 配置类如不内部不存在@bean方法引用应加: proxyBeanMethods = false 以去除不必要代理类
 ie: `@Configuration(proxyBeanMethods = false)`

此PR是了消除启动时的以下日志:

```
 [restartedMain] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker[376] - Bean 'spring.datasource.dynamic-com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties' of type [com.baomidou.dynamic.datasource.spring.boot.autoconfigure.DynamicDataSourceProperties] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
12-23 09:29:16.779 [restartedMain] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker[376] - Bean 'dsProcessor' of type [com.baomidou.dynamic.datasource.processor.DsHeaderProcessor] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
```
@huayanYu huayanYu merged commit b6d2595 into baomidou:master Jan 2, 2024
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.

2 participants