I want to read @Bean
annotations name
attribute value from properties file, something like below.
Properties File:
myBeanName: abc
In java code I want to achieve as below,
@Bean(name = "${myBeanName}")
Which should be equal to @Bean(name = "abc")
Thanks in advance.
You can achieve this with https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/ImportBeanDefinitionRegistrar.html
But I think your actual problem has easier solution
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.