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

12th
Sep 2016
Spencer Gibb
@spencergibb
Sep 12 2016 14:24
@pradeepkusingh if you are routing through the CF lb you’ll only round robbin health check to the instances.
Daco
@dacofr
Sep 12 2016 14:34
Hi Springboot team,
i've an application connected to a config server
does the keys in src/test/resources/application.properties overwrite the key that are in the config server ?
Stéphane Nicoll
@snicoll
Sep 12 2016 14:36
using the config server in a test scenario looks very weird to me
Spencer Gibb
@spencergibb
Sep 12 2016 14:36
yes, it does look odd. config server has highest precedence.
Daco
@dacofr
Sep 12 2016 14:39
@snicoll how can i desactivate config server durant my tests ?
Spencer Gibb
@spencergibb
Sep 12 2016 14:40
@dacofr what is the problem?
Daco
@dacofr
Sep 12 2016 14:41
I've one application with DAO test that are connected to H2.
Now i connect this application to my config server and my tests failed
Spencer Gibb
@spencergibb
Sep 12 2016 14:41
why is it connected to config server during a test?
Stéphane Nicoll
@snicoll
Sep 12 2016 14:41
I guess his main spring boot app has @EnableDiscoveryClient
and that’s being used by the tests, right @dacofr ?
Spencer Gibb
@spencergibb
Sep 12 2016 14:42
that’s eureka/consul not config client btw
Stéphane Nicoll
@snicoll
Sep 12 2016 14:42
Oh yeah, the other enable thing :)
Daco
@dacofr
Sep 12 2016 14:42
yes i use @EnableDiscoveryClient
Spencer Gibb
@spencergibb
Sep 12 2016 14:42
config client is just auto config, not @Enable*.
Stéphane Nicoll
@snicoll
Sep 12 2016 14:43
confused
Spencer Gibb
@spencergibb
Sep 12 2016 14:43
you can disable the config client with spring.cloud.config.enabled=false.
Stéphane Nicoll
@snicoll
Sep 12 2016 14:43
What’s the strategy for not having that to kick in in tests then?
Daco
@dacofr
Sep 12 2016 14:46
@spencergibb i've put spring.cloud.config.enabled=false in my application.properties in src/test/resources and my test will always "Fetching config from server"
Spencer Gibb
@spencergibb
Sep 12 2016 14:46
it needs to go in bootstrap.properties.
Daco
@dacofr
Sep 12 2016 14:47
ok, works now
thanks
ok, so in my src/main/resources i've a bootstrap.properties with spring.application.name, spring.cloud.config.uri
and in src/test/resources a bootstrap.properties with spring.cloud.config.enabled=false
is it the goodway ?
Spencer Gibb
@spencergibb
Sep 12 2016 14:51
yes
Daco
@dacofr
Sep 12 2016 14:52
ok, thanks @spencergibb and @snicoll
Daco
@dacofr
Sep 12 2016 15:05
@spencergibb where can i found a page that indicate in which order are loaded application-*.properties with a config server ?
Daco
@dacofr
Sep 12 2016 15:15
Thanks
pradeepkusingh
@pradeepkusingh
Sep 12 2016 16:18
@spencergibb Thank you
David Welch
@dwelch2344
Sep 12 2016 16:54
Question on SC+Feign: is there a way to wrap / provide a delegate (or just a stub) to override a feign client in a consuming project? We basically want to provide a hard coded instance for local dev / in lower lanes. But if we provide an impl in a @Configuration it doesn't get autowired in
Spencer Gibb
@spencergibb
Sep 12 2016 20:39
@dwelch2344 not really. Maybe with profiles to spring-cloud never creates the proxy.
maybe a custom feign Target?
David Welch
@dwelch2344
Sep 12 2016 21:10
Arg yeah it turned out to be tricky
Tried getting in / around the FactoryBean / Registrar, but that got hairy fast
Ended up throwing a PostProcessor in the mix to patch the one class that uses it. Nasty, but does the trick for now
David Welch
@dwelch2344
Sep 12 2016 23:51
Doesn't SC+Netflix create a Discovery-aware RestTemplate for you automatically?
or is that only with Eureka?
Marcos Barbero
@marcosbarbero
Sep 12 2016 23:54
I think you can work it out using @LoadBalanced annotation while auto wiring the RestTemplate
David Welch
@dwelch2344
Sep 12 2016 23:56
hmmm no dice. might be my setup though as we've done that in another service
will have to poke around. wiring in the discoveryclient works so the infrastructure is there :/