From 77c0349de2cf8e0996f5b56cca851c1f7a3d3719 Mon Sep 17 00:00:00 2001 From: spencergibb Date: Mon, 15 Mar 2021 21:13:56 -0400 Subject: [PATCH] Don't run bootstrapper if legacy bootstrap starter present. Fixes gh-714 --- .../configclient/ConsulConfigServerBootstrapper.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/configclient/ConsulConfigServerBootstrapper.java b/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/configclient/ConsulConfigServerBootstrapper.java index 1b088301..61db5745 100644 --- a/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/configclient/ConsulConfigServerBootstrapper.java +++ b/spring-cloud-consul-discovery/src/main/java/org/springframework/cloud/consul/discovery/configclient/ConsulConfigServerBootstrapper.java @@ -37,7 +37,9 @@ public class ConsulConfigServerBootstrapper implements Bootstrapper { @Override public void intitialize(BootstrapRegistry registry) { - if (!ClassUtils.isPresent("org.springframework.cloud.config.client.ConfigServerInstanceProvider", null)) { + if (!ClassUtils.isPresent("org.springframework.cloud.config.client.ConfigServerInstanceProvider", null) || + // don't run if bootstrap enabled, how to check the property? + ClassUtils.isPresent("org.springframework.cloud.bootstrap.marker.Marker", null)) { return; } // create consul client