Added usage of spring.cloud.vault.reactive.enabled property in VaultConfigDataLoader
Closes gh-619 Original pull request: gh-618.
This commit is contained in:
@@ -127,7 +127,7 @@ public class VaultConfigDataLoader implements ConfigDataLoader<VaultConfigLocati
|
||||
|
||||
registerImperativeInfrastructure(bootstrap, vaultProperties);
|
||||
|
||||
if (REGISTER_REACTIVE_INFRASTRUCTURE) {
|
||||
if (REGISTER_REACTIVE_INFRASTRUCTURE && vaultProperties.getReactive().isEnabled()) {
|
||||
registerReactiveInfrastructure(bootstrap, vaultProperties);
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ public class VaultConfigDataLoader implements ConfigDataLoader<VaultConfigLocati
|
||||
|
||||
infra.registerClientAuthentication();
|
||||
|
||||
if (!REGISTER_REACTIVE_INFRASTRUCTURE) {
|
||||
if (!REGISTER_REACTIVE_INFRASTRUCTURE || !vaultProperties.getReactive().isEnabled()) {
|
||||
infra.registerVaultSessionManager();
|
||||
}
|
||||
|
||||
|
||||
@@ -82,6 +82,11 @@ public class VaultProperties implements EnvironmentAware {
|
||||
@Nullable
|
||||
private String namespace;
|
||||
|
||||
/**
|
||||
* Reactive properties
|
||||
*/
|
||||
private Reactive reactive = new Reactive();
|
||||
|
||||
/**
|
||||
* Discovery properties.
|
||||
*/
|
||||
@@ -199,6 +204,14 @@ public class VaultProperties implements EnvironmentAware {
|
||||
this.namespace = namespace;
|
||||
}
|
||||
|
||||
public Reactive getReactive() {
|
||||
return this.reactive;
|
||||
}
|
||||
|
||||
public void setReactive(Reactive reactive) {
|
||||
this.reactive = reactive;
|
||||
}
|
||||
|
||||
public Discovery getDiscovery() {
|
||||
return this.discovery;
|
||||
}
|
||||
@@ -361,6 +374,24 @@ public class VaultProperties implements EnvironmentAware {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Reactive properties.
|
||||
*/
|
||||
public static class Reactive {
|
||||
/**
|
||||
* Flag to indicate that reactive discovery is enabled
|
||||
*/
|
||||
private boolean enabled = true;
|
||||
|
||||
public boolean isEnabled() {
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
public void setEnabled(boolean enabled) {
|
||||
this.enabled = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Discovery properties.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user