diff --git a/gravitee-node-container/src/main/java/io/gravitee/node/container/spring/env/AbstractGraviteePropertySource.java b/gravitee-node-container/src/main/java/io/gravitee/node/container/spring/env/AbstractGraviteePropertySource.java index cab689aa1..a53320af3 100644 --- a/gravitee-node-container/src/main/java/io/gravitee/node/container/spring/env/AbstractGraviteePropertySource.java +++ b/gravitee-node-container/src/main/java/io/gravitee/node/container/spring/env/AbstractGraviteePropertySource.java @@ -18,6 +18,8 @@ import io.gravitee.node.api.secrets.resolver.PropertyResolver; import io.gravitee.node.api.secrets.resolver.PropertyResolverFactoriesLoader; import io.gravitee.node.api.secrets.resolver.WatchablePropertyResolver; +import io.reactivex.rxjava3.core.Flowable; +import io.reactivex.rxjava3.schedulers.Schedulers; import java.util.Arrays; import java.util.Map; import java.util.Objects; @@ -80,9 +82,10 @@ public Object getProperty(String name) { protected abstract Object getValue(String key); private void watchProperty(WatchablePropertyResolver propertyResolver, String name, Object value) { - propertyResolver - .watch(value.toString()) - .doOnComplete(() -> watchProperty(propertyResolver, name, value)) + Flowable + .defer(() -> propertyResolver.watch(value.toString())) + .subscribeOn(Schedulers.io()) + .repeat() .subscribe(newValue -> source.put(name, newValue), t -> LOGGER.error("Unable to update property {}", name, t)); }