Closed melloware closed 8 months ago
@phillip-kruger I am working on this and I want to put the values of this Embedded Postres in the DevServices panel.
I have this code.
@BuildStep
void registerDevServices(BuildProducer<DevServicesResultBuildItem> devServices) {
Map<String, String> devServerConfigMap = new LinkedHashMap<>();
Config config = ConfigProviderResolver.instance().getConfig();
for (String propertyName : config.getPropertyNames()) {
if (propertyName.startsWith("quarkus.datasource.")) {
devServerConfigMap.put(propertyName, config.getConfigValue(propertyName).getValue());
}
}
DevServicesResultBuildItem.RunningDevService devService = new DevServicesResultBuildItem.RunningDevService(
FEATURE, null, null, devServerConfigMap);
devServices.produce(devService.toBuildItem());
}
But its only producing BuildTime values not the run time values on the ConfigProvider?
How can I get the DevServices to show the Run Time configured Datasource values?
Hi! I am not sure I am following? The properties you see in the dev service screen are the "magic" ones. I.e. the properties set by dev service automatically so that the service run. This is so that the user know what they need to set themself in a prod environment where there is no dev service and they need to provide the service themselves
Normal config related to an extension can be seen in the config screen when navigation there from the extension card. It will use the filter value in the extension yaml and filter the navigation screen accordingly
Oh I forgot to mention this is an embedded service so its not a REAL Container Dev Service is running embedded DB. So like in Quinoa we do this to put the "fake" DevService in the list for Node.js. I was hoping to do something similar here.
@BuildStep
void registerDevServices(BuildProducer<DevServicesResultBuildItem> devServices) {
Map<String, String> devServerConfigMap = new LinkedHashMap<>();
Config config = ConfigProviderResolver.instance().getConfig();
for (String propertyName : config.getPropertyNames()) {
if (propertyName.startsWith("quarkus.datasource.")) {
devServerConfigMap.put(propertyName, config.getConfigValue(propertyName).getValue());
}
}
DevServicesResultBuildItem.RunningDevService devService = new DevServicesResultBuildItem.RunningDevService(
FEATURE, null, null, devServerConfigMap);
devServices.produce(devService.toBuildItem());
}
But are you not just after the filtered configuration feature that already exists?
No at runtime it dynamically assigns to quarkus.datasource.jdbc.url
to jdbc:postgresql://localhost:60290/postgres
But that should show up in the config screen?
It looks like its only has build time properties that are in the application.properties when I ask ConfigProvider
.
Sorry yes its on the Config screen because it looks like you using a JsonRpcProvider that has access to runtime values?
I guess the question is how is it possible to have the DevServices info use Runtime values?
Ok, so let a dev ui question and more a dev service question? I think so, but let me see if I can find an example. Give me a few hours, doing morning school runs etc at the moment
No problem! Yeah I got the DevUI card using a JsonRpcService to get the port and running URL but was wondering how to jam it on DevServices too.
I don't think this is possible at the moment. The dev services is built time data. We would need to change that to jsonrpc to get run time data. Or maybe a mix / config that allows this.
No worries I think based on the other ticket I am going to end up making this a build time config anyway to refactor for the 3.6.0 issues
You can assign this to me.