You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by "robben009 (via GitHub)" <gi...@apache.org> on 2024/11/12 07:07:57 UTC
[I] Why cannot I obtain the placeholder from the configuration file [shardingsphere]
robben009 opened a new issue, #33626:
URL: https://github.com/apache/shardingsphere/issues/33626
l hava a application.yml config file. file have a config content is
```
dbPwd: 1234556
spring:
datasource:
driver-class-name: org.apache.shardingsphere.driver.ShardingSphereDriver
url: jdbc:shardingsphere:classpath:sharding-dev.yml?placeholder-type=system_props
```
and l hava a sharding-dev.yml file,config content is
```
dataSources:
ds_0:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.cj.jdbc.Driver
jdbcUrl: ***
username: ***
password: $${dbPwd::}
```
why $${dbPwd::} is not effect?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Why cannot I obtain the placeholder from the configuration file [shardingsphere]
Posted by "robben009 (via GitHub)" <gi...@apache.org>.
robben009 commented on issue #33626:
URL: https://github.com/apache/shardingsphere/issues/33626#issuecomment-2469893262
ok l get, thanks
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Why cannot I obtain the placeholder from the configuration file [shardingsphere]
Posted by "robben009 (via GitHub)" <gi...@apache.org>.
robben009 commented on issue #33626:
URL: https://github.com/apache/shardingsphere/issues/33626#issuecomment-2469819209
> Obviously, it's because you haven't set the system property of `dbPwd`. The content in `application.yml` will not be automatically set as system properties.
Is there support for getting properties from application.properties instead of placeholders
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Why cannot I obtain the placeholder from the configuration file [shardingsphere]
Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #33626:
URL: https://github.com/apache/shardingsphere/issues/33626#issuecomment-2469884615
By the way, you can create a spring bean of applicationrunner to initialize a bunch of system properties.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Why cannot I obtain the placeholder from the configuration file [shardingsphere]
Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #33626:
URL: https://github.com/apache/shardingsphere/issues/33626#issuecomment-2469813816
Obviously, it's because you haven't set the system property of `dbPwd`. The content in `application.yml` will not be automatically set as system properties.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Why cannot I obtain the placeholder from the configuration file [shardingsphere]
Posted by "terrymanu (via GitHub)" <gi...@apache.org>.
terrymanu closed issue #33626: Why cannot I obtain the placeholder from the configuration file
URL: https://github.com/apache/shardingsphere/issues/33626
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Why cannot I obtain the placeholder from the configuration file [shardingsphere]
Posted by "linghengqian (via GitHub)" <gi...@apache.org>.
linghengqian commented on issue #33626:
URL: https://github.com/apache/shardingsphere/issues/33626#issuecomment-2469832416
- In this case, you need to actively implement the spi of the shardingsphere jdbc driver to read the `application.yml` on the classpath.
- You cannot put the spi implementation class of shardingsphere into the life cycle of spring context, because shardingsphere jdbc datasource allows multiple instances, and the spi implementation class is easily created and used by internal classes. For spring boot, you can directly regard spring context as a single instance such as jaas.
- I would say you can feel free to consult the spring boot documentation to understand why the spring context's internal map itself is not suitable for storing metadata.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] Why cannot I obtain the placeholder from the configuration file [shardingsphere]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #33626:
URL: https://github.com/apache/shardingsphere/issues/33626#issuecomment-2486645098
There hasn't been any activity on this issue recently, and in order to prioritize active issues, it will be marked as stale.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@shardingsphere.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org