diff --git a/spring-cloud-config-client/src/main/java/org/springframework/cloud/bootstrap/BootstrapApplicationListener.java b/spring-cloud-config-client/src/main/java/org/springframework/cloud/bootstrap/BootstrapApplicationListener.java index 4fc6894c..005b8a34 100644 --- a/spring-cloud-config-client/src/main/java/org/springframework/cloud/bootstrap/BootstrapApplicationListener.java +++ b/spring-cloud-config-client/src/main/java/org/springframework/cloud/bootstrap/BootstrapApplicationListener.java @@ -98,8 +98,8 @@ public class BootstrapApplicationListener implements if (StringUtils.hasText(configLocation)) { bootstrapMap.put("spring.config.location", configName); } - bootstrapMap.put("spring.application.name", configName); - bootstrapProperties.addFirst(new MapPropertySource(BOOTSTRAP_PROPERTY_SOURCE_NAME, bootstrapMap)); + bootstrapProperties.addFirst(new MapPropertySource( + BOOTSTRAP_PROPERTY_SOURCE_NAME, bootstrapMap)); bootstrapProperties.addFirst(new MapPropertySource("bootstrapInProgress", Collections. emptyMap())); for (PropertySource source : environment.getPropertySources()) { @@ -112,7 +112,8 @@ public class BootstrapApplicationListener implements // TODO: is it possible or sensible to share a ResourceLoader? SpringApplicationBuilder builder = new SpringApplicationBuilder() .profiles(environment.getActiveProfiles()).showBanner(false) - .environment(bootstrapEnvironment).web(false); + .environment(bootstrapEnvironment) + .properties("spring.application.name:" + configName).web(false); List> sources = new ArrayList>(); for (String name : names) { Class cls = ClassUtils.resolveClassName(name, null);