How to get Spring Cloud Application Name

Answered

when i develop a plugin for Spring Cloud App, i need to known the Application name.

spring.application.name=DEMO

The properties file is application.properties or application.yml.

 

1 comment
Comment actions Permalink

Try

val instance = SpringBootApplicationMetaConfigKeyManager.getInstance()
val name = instance.findCanonicalApplicationMetaConfigKey(module, "spring.application.name")
0

Please sign in to leave a comment.