-
Notifications
You must be signed in to change notification settings - Fork 46
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
The @ConfigurationProperties annotation injects null values when decorates a @Bean method in a @Configuration class #19
Comments
We don't currently support returning |
Ok, thanks @graemerocher for your quick reply. @Bean
@Primary
@ConfigurationProperties(prefix="spring.datasource")
public DataSource primaryDataSource() {
return DataSourceBuilder.create().build();
}
@Bean
@ConfigurationProperties(prefix="spring.secondDatasource")
public DataSource secondaryDataSource() {
return DataSourceBuilder.create().build();
} We would like to use Micronaut for existing Spring Boot microservices and we would like to estimate the refactoring cost if needed. Thanks in advance! |
Since Micronaut does things at compilation time. You have a couple of options.
|
Thanks @graemerocher for your reply! |
Hi,
The ConfigurationProperties annotation injects null values when is used to decorate a Bean method in a Configuration class. I have forked the repository and added an example bean which is configured using the configuration properties annotation. The bean values are populated correctly using only Spring Boot dependencies but the bean configuration properties are populated with null values when Micronaut is used. Here is the commit with the example:
igarciaes@1fb0d4b
I am missing something?
Thanks!
The text was updated successfully, but these errors were encountered: