Improvement - quarkus should make an attempt to read config file using Thread's ContextClassLoader #6035

pull/6080/head
Nikita Koksharov 6 months ago
parent e9b85b4d45
commit da31eb7f8b

@ -61,6 +61,9 @@ public class RedissonClientProducer {
Optional<String> configFile = ConfigProvider.getConfig().getOptionalValue("quarkus.redisson.file", String.class); Optional<String> configFile = ConfigProvider.getConfig().getOptionalValue("quarkus.redisson.file", String.class);
if (configFile.isPresent()) { if (configFile.isPresent()) {
configStream = getClass().getResourceAsStream(configFile.get()); configStream = getClass().getResourceAsStream(configFile.get());
if (configStream == null) {
configStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(configFile.get());
}
} else { } else {
configStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("redisson.yaml"); configStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("redisson.yaml");
} }

@ -61,6 +61,9 @@ public class RedissonClientProducer {
Optional<String> configFile = ConfigProvider.getConfig().getOptionalValue("quarkus.redisson.file", String.class); Optional<String> configFile = ConfigProvider.getConfig().getOptionalValue("quarkus.redisson.file", String.class);
if (configFile.isPresent()) { if (configFile.isPresent()) {
configStream = getClass().getResourceAsStream(configFile.get()); configStream = getClass().getResourceAsStream(configFile.get());
if (configStream == null) {
configStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(configFile.get());
}
} else { } else {
configStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("redisson.yaml"); configStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("redisson.yaml");
} }

@ -61,6 +61,9 @@ public class RedissonClientProducer {
Optional<String> configFile = ConfigProvider.getConfig().getOptionalValue("quarkus.redisson.file", String.class); Optional<String> configFile = ConfigProvider.getConfig().getOptionalValue("quarkus.redisson.file", String.class);
if (configFile.isPresent()) { if (configFile.isPresent()) {
configStream = getClass().getResourceAsStream(configFile.get()); configStream = getClass().getResourceAsStream(configFile.get());
if (configStream == null) {
configStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(configFile.get());
}
} else { } else {
configStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("redisson.yaml"); configStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("redisson.yaml");
} }

Loading…
Cancel
Save