Open bsorrentino opened 6 years ago
We certainly cant make this type of change in a minor release. I am also a little wondering if you have looked at other ways of achieving this. Maybe the config can return the configuration data for all devices and all locations and clients can just take what they need? Or you could add your own endpoint to the config server that uses the EnvironmentRepository
interface but then further refines that configuration information returned based on the location and device before returning it to the client.
Hi @ryanjbaxter
Thanks for response ... as you say there are other solutions.
The issue was to understand if i can achieve this reusing the spring-cloud-config-server
architecture as-is because, in my opinion, I consider the proposal an enhancement for who would want use spring-cloud-config-server
out of spring space or also customising the rest call from spring-cloud-config-client
Yeah I cant think of any way that might work out of the box, besides filtering the configuration data on the client.
Config server is built as a normal boot application so your number 2 and 3 above work. I'm not keen on pushing anything http specific down to the API. Let's see if anyone else is interested in this.
Hi @spencergibb firstly thanks for taking request in consideration. I perfectly understand and agree with you
I'm not keen on pushing anything http specific down to the API
However the request
object could be easily substituted by a kind of context
or simply a map
Problem
I have to access to config server besides springboot applications also from SPA (AngularJS).
I've used the REST api provided out-of-box from config server but the triad
application/profile/label
seem to me is not enough to express the complexity coming out from my requirements.Requirements
The natural solution that I've imaged was to call api like
application/profile/label?device=x&location=y
but I haven't found a simple way to achieve that.Solution
The solution that I've figured out are:
profile
and/orlabel
like Json object (eg.application/profile/{label:'',device:'',location:''}
)ThreadLocal
Proposal
During this analysis I've figured out that if the
Request
object will be passed tofindOne(String application, String profile, String label);
method ofEnvironmentRepository
this allowing to use query parameters as further filter to select the rightEnvironment
The proposal is to extends the
EnvironmentRepository
interface as show belowand update
ResourceController
accordly with new interface