This is an enhancement request to be able to use the app "name" (from the URL /{name}/{profile}/{label}/{path}
) when serving plain text files.
Use case
I want to make available a conf file or XML logging configuration file (plain text files) for use by applications that are not using the Spring Cloud Config client library. In these plain text files, I want certain values to contain the application's name. However, since the application (let's say "myapi") does not use the client library, there is no myapi.properties
or myapi.yml
file in the config repo.
Thus, when requesting http://my-config-server/myapi/dev/master/app.conf
, the {name}
"myapi" is not available for use like below.
app.conf:
LOG_FOLDER=/var/log/{name}
Workaround
Of course, adding a file myapi.properties
(or myapi.yml
) with a property like spring.application.name=myapi
to the config repo will allow me to use ${spring.application.name}
in the plain text file. However this adds the requirement of adding a properties file with this one value for every client that wants to use this common configuration file served as a plain text file. This could be avoided if the name
path variable were available in the Environment resolving the placeholders.
Does this request seem like a worthwhile enhancement?
Comment From: dsyer
It seems worthwhile, but not clear to me how to handle profile (in particular) since it can be multi-valued. I would also prefer to stick to Spring placeholder conventions (using ${}
for instance).
Comment From: valmol
Would be nice to use path variables like {name}, {profiles} as placeholders when serving plain text A also fetch template as plain text in via shell and would like to use ${name} placeholder in template Now I have to add app.name into config yaml and use ${app.name} placeholder