Closed sunqb closed 3 years ago
can you provide an accurate reproducer ?
can you provide an accurate reproducer ?
OK。like this:
config code :
private static ConfigRetrieverOptions initOptions() {
ConfigRetrieverOptions options = new ConfigRetrieverOptions().setIncludeDefaultStores(true);
options.setScanPeriod(-1);
// raw-data
options.addStore(new ConfigStoreOptions().setType("file").setFormat("properties").setOptional(true)
.setConfig(new JsonObject().put("path", "conf/config.properties").put("raw-data", true)));
options.getStores().forEach(store -> store.getConfig().put("cache", "false"));
return options;
}
properties content:
web.mysql.host=10.10.14.59 web.mysql.port=3306 web.mysql.db=hq_usp_studyfun_bf_nh web.mysql.user=root web.mysql.password=123456
comment:
when i do not use put("raw-data", true) . i can't use config().getString("web.mysql.password"),because i get a value "123456.0" ,i expect to get "123456"
if i use ("raw-data", true) . i can only use config().getString("web.mysql.password"). i can't use config().getInteger("web.mysql.port").
@vietj if I change config file from config.properties to config.json。it works well。so i think this may by a bug,when i use properties
can you find out what is the actual issue ?
can you find out what is the actual issue ?
yes the problem is JsonObjectHelper.convert(String value) ,please look below ,and do you have any other considerations ????
@vietj the function should give a chioce ,i think.
eg: store more data of this value, when i use getString ,return "123456" , when i use getDoule, return 123456.0 , when i use getInteger , return 123456
@vietj i use spi to solve this problem , do you want to fix this problem at vertx 4.0.3 ?
yes we do.
On Thu, Feb 25, 2021 at 2:47 AM sunqb notifications@github.com wrote:
@vietj https://github.com/vietj i use spi to solve this problem , do you want to fix this problem at vertx 4.0.3 ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/vert-x3/vertx-config/issues/124#issuecomment-785514976, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABXDCT7U3NRI7QCKYALEETTAWT4BANCNFSM4YAJFZXQ .
Question
when i do not use "put("raw-data", true)" ,if my config is : password=123456
I get a value "123456.0" by this method config.getString("password");
but
when I use "put("raw-data", true)", this problem is ok ,but i have an other config port=80
I get an error when i use config.getInteger("port"),because it was not supported.
Version
4.0.2
the link is from https://github.com/eclipse-vertx/vert.x/issues/3816