Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch correct spring.application.name in Spring Cloud 1.x #328

Closed
QilongZhang opened this issue Jan 2, 2019 · 0 comments
Closed

Fetch correct spring.application.name in Spring Cloud 1.x #328

QilongZhang opened this issue Jan 2, 2019 · 0 comments
Labels
optimization Code optimization
Milestone

Comments

@QilongZhang
Copy link
Contributor

After #320 , we cant fetch correct spring.application.name in Spring Cloud 1.x. As BootstrapApplicationListener set a default name. The code patch is similar to the following:

String configName = environment
         .resolvePlaceholders("${spring.cloud.bootstrap.name:bootstrap}");
SpringApplicationBuilder builder = new SpringApplicationBuilder()
	 profiles(environment.getActiveProfiles()).bannerMode(Mode.OFF)
	 .environment(bootstrapEnvironment)
	 .properties("spring.application.name:" + configName)
	 .registerShutdownHook(false).logStartupInfo(false).web(false);
@QilongZhang QilongZhang added the optimization Code optimization label Jan 2, 2019
@QilongZhang QilongZhang added this to the 2.6.0 milestone Jan 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
optimization Code optimization
Projects
None yet
Development

No branches or pull requests

1 participant