You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@shardingsphere.apache.org by GitBox <gi...@apache.org> on 2019/01/18 07:42:47 UTC

[GitHub] xuminwlt edited a comment on issue #1687: Support springboot placeholder configruation for Sharding-springboot

xuminwlt edited a comment on issue #1687: Support springboot placeholder configruation for Sharding-springboot
URL: https://github.com/apache/incubator-shardingsphere/issues/1687#issuecomment-455454572
 
 
   I test the code from project sharding-spring/sharding-jdbc-spring-boot-starter, It's already support by spring environment.
   
   config
   ```
   sharding.jdbc.datasource.names=ds_master,ds_slave_${random.int(2)}
   
   ```
   
   code result
   ```
           String prefix = "sharding.jdbc.datasource.";
           String dataSources = environment.getProperty(prefix + "names");
   ```
   then dataSources print
   - ds_master,ds_slave_0
   or
   - ds_master,ds_slave_1
   
   Config in spring boot will prepare some default propertySources like this
   ![image](https://user-images.githubusercontent.com/5835937/51372067-ed9a3100-1b36-11e9-8105-3221739ec06c.png)
   
   Placeholder ${some.propertie.names} is also supported.
   
   Maybe I don't get the issue's mean.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services