Bug: Props can not be found with MicronautBeanProcessor
I am not sure this is the correct repo or not but I am trying to make use MicronautBeanProcessor.
My problem is that Micronaut can not resolve Spring's properties.
For EachProperty part of DataJdbcConfiguration configuration:
https://github.com/micronaut-projects/micronaut-data/blob/c1d1dc3cdee0e73125e1bc58d05c05d23c1e0633/data-jdbc/src/main/java/io/micronaut/data/jdbc/config/DataJdbcConfiguration.java#L34-L35
@EachProperty(value = DataJdbcConfiguration.PREFIX, primary = "default")
public class DataJdbcConfiguration implements Named {
it triggers:
https://github.com/micronaut-projects/micronaut-spring/blob/b783d603cb566bb98f779723af9861e3722e3712/spring/src/main/java/io/micronaut/spring/beans/MicronautBeanProcessor.java#L93-L96
However name's value is datasources. When it delegates to Spring it can not find this property. datasouces.default.url works.
I am little surprised why this is not hit before.
my prop is like this:
datasources:
default:
url: "jdbc:mysql://localhost:3306/cemo?useSSL=false"
username: "root"
password: ""
driverClassName: com.mysql.cj.jdbc.Driver
```
Any help?
Can you provide an example?
@graemerocher
https://github.com/cemo/micronaut-spring-84 here is the example.
- put a breakpoint DefaultEnvironment#getProperty inside MicronautBeanProcessor. You will see that it is not resolved.
https://github.com/micronaut-projects/micronaut-spring/blob/b783d603cb566bb98f779723af9861e3722e3712/spring/src/main/java/io/micronaut/spring/beans/MicronautBeanProcessor.java#L93-L96
I make it raise an error on RegionService class to show that something is not configured correctly.
PS: After resolving all issues using Micronaut data inside Spring will be so beautiful :)
Another approach can be using Spring's property sources as Micronaut.
https://gist.github.com/cemo/b26b1fb8bc814e2213b1f43dedf6a2bc/
This is working.