java - How to extend Spring Boot's DataSourceAutoConfiguration -


I want to take advantage of the spring boot data source auto configuration. Although this does not specifically support all the features I am using, logValidationErrors . driver: Client: source: driverClassName: oracle.jdbc.OracleDriver url: jdbc: jtds: sqlserver: //111.11.11.11 / database name Username: no password: no testing testnonbrows: true testwiyel: true verification : Select / * Verification * * 1 / dual minivictable idle milliseconds: 1000 Validation interval: 30000

They are not currently being used:

  logValidationErrors: True Max Edge: 1800000 # // 30 minutes Waste Age Extraction Maximum: True   

Do I Have Datasource Bean made and manually set those values? Or is there a better way to extend or wrap the autoconfiguration? For more information about

log-validation auctions , etc., see:

I have solved it with BeanPostProcessor , similar to the suggestion of Dave Sirs:

  @Override Public Object post processApplied before you (object Bean, string beanam) throws the beans exposition (if (bien instance of datasource) {datasource ds = (datasource) bean; ds.setLogValidationErrors (true); ds.setRe MoveAbandoned (right); ds.setMaxAge (1800000);} Return bean;}   

I can also submit a PR to get the properties involved in the spring boot < / P>

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -