These are chat archives for spring-cloud/spring-cloud

22nd
Mar 2016
David Welch
@dwelch2344
Mar 22 2016 16:53

so @spencergibb: if we have a users app with 2 profiles set (say dev and deploy) -- will the keys that match be config/users,dev/data and config/users,deploy/data, or will it be config/users,dev,deploy/data?

I'd imagine order matters on profiles if it's the latter, but will match whatever we specify via SPRING_PROFILES_ACTIVE

Spencer Gibb
@spencergibb
Mar 22 2016 17:05
@dwelch2344 good question
David Welch
@dwelch2344
Mar 22 2016 17:05
we were seeing a few odd behaviors when rolling out with multiple, but it looks like specifying them each individually works best
just wanted to see if there was an advised pattern
Spencer Gibb
@spencergibb
Mar 22 2016 17:05
config server probably deals with it better
Spencer Gibb
@spencergibb
Mar 22 2016 17:13
@dwelch2344 did you see the support for git2consul formatted keys? basically the key is a filename. rather than config/users,dev/data it’s config/users-dev.yml or something similar.
David Welch
@dwelch2344
Mar 22 2016 17:14
I'm pretty sure config server matched the latter, with all run together. I think composition of the individual profiles (hopefully prioritized by first specified) makes the most sense / is most natural
Oooo no I didn't! that's sweet! we'll probably go to that
Spencer Gibb
@spencergibb
Mar 22 2016 17:15
yeah, it finds them based on boot. consul config mimics boot, therefore likely has bugs :-) We could probably do a cross product of the profiles and find the matches so order doesn’t matter.
Kaleb Scholes
@kalebscholes
Mar 22 2016 17:17
oh good info on the git2consul!
David Welch
@dwelch2344
Mar 22 2016 17:19
well, I'd actually rather have order matter. so that I could do something like users-dev,deploy and users-uat,deploy -- where multiple lanes share deploy, but if UAT needs to it can reliably override something in deploy
Spencer Gibb
@spencergibb
Mar 22 2016 17:22
cool
David Welch
@dwelch2344
Mar 22 2016 17:25
alright, last question: we've got our services in docker containers and registering with consul, all on aws. So far, awesome. Only problem: we kill the docker container, Consul doesn't deregister them. I'm guessing the containers are killed before Spring Cloud can clean up... sound like the problem?
Spencer Gibb
@spencergibb
Mar 22 2016 17:27
Yes, if you kill a cloud app properly it will deregister itself. Not sure how killing a docker container trickles down. Maybe there are some hooks. Good thing is consul will mark them as critical and they should be part of ribbon lookups anymore. Just garbage in consul.
or maybe your shutdown procedure needs to change, stop all spring cloud services before killing container
David Welch
@dwelch2344
Mar 22 2016 17:29
Yeah, lottts of garbage in consul :(
yeah, I need to look into that. We're using cloud.docker.com for a while, so gotta see what they can do. but definitely ideal
Spencer Gibb
@spencergibb
Mar 22 2016 17:30
maybe you could set the ttl check for dev. Not sure if consul auto cleans services past the ttl, or just marks them critical.
David Welch
@dwelch2344
Mar 22 2016 20:07
good thought. will look into it
Kaleb Scholes
@kalebscholes
Mar 22 2016 21:38
I'm attempting to use traverson to build links and I got it mostly working but not sure how to follow the url to /accounts/1. I've set up a bean to return a DiscoveredResourcedoing something along the lines of return new DiscoveredResource(provider, traverson -> traverson.follow("accounts")) but how do I get it to follow and expand the link to include the id?
Dave Syer
@dsyer
Mar 22 2016 21:50
Is that specifically in the context of Spring Cloud?
Kaleb Scholes
@kalebscholes
Mar 22 2016 21:52
yes i'm using spring cloud
Dave Syer
@dsyer
Mar 22 2016 21:54
OK. Thanks for clarifying.
I haven't used that stuff. We might need to call @ogierke
Spencer Gibb
@spencergibb
Mar 22 2016 21:54
I was trying to find his github handle to do that :-)
Dave Syer
@dsyer
Mar 22 2016 21:54
@olivergierke
Spencer Gibb
@spencergibb
Mar 22 2016 21:55
yeah, that one
David Welch
@dwelch2344
Mar 22 2016 22:13
@spencergibb if we specify TTL on the consul discovery service, will the discovery client automatically keep "checking in"?
Spencer Gibb
@spencergibb
Mar 22 2016 22:13
yes, it should
Spencer Gibb
@spencergibb
Mar 22 2016 22:19
not sure it’s been tested in real life though