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

21st
Feb 2017
Rakesh
@aroraisonline_twitter
Feb 21 2017 06:33
can anybody help me setting up zuul in aws?
i am replacing Nginx plus with zuul. i am from devops and need basic pre built packages for setting up zuul.
didn't find on net any package
Spencer Gibb
@spencergibb
Feb 21 2017 11:07
There aren't pre built packages
Niklas Herder
@herder
Feb 21 2017 12:43
Hi, I have a config server which serves properties from its own repository, and would like that server to read its config from a Eureka-registered central config server. Is that supposed to be possible?
Dave Syer
@dsyer
Feb 21 2017 12:51
Normally you don't want the config server to be a config client itself, so this listener disables the config client unless spring.cloud.config.enabled is explicitly "true". It has to be "true" at the time this listener is fired, which means before the bootstrap.yml is parsed, which in turn means to you need to launch the application with an existing primed Environment (e.g. via System properties or a SpringApplicationBuilder). This is the same rule of precedence as for anything else affecting the bootstrap process itself, e.g. setting spring.cloud.bootstrap.name to something other than "bootstrap".
(javadocs of ConfigServerBootstrapApplicationListener)
Niklas Herder
@herder
Feb 21 2017 12:51
Ah, huge thanks! A case of RTFM fail on my part here... :) Thanks again!
Rakesh
@aroraisonline_twitter
Feb 21 2017 13:53
Then how to get zuul setup for load balancing thing?
Kyle Anderson
@andersonkyle
Feb 21 2017 16:33
@spencergibb @dsyer I'm running up against spring-cloud/spring-cloud-netflix#8 Zuul Response Location issue. Is there any example config to help alleviate this problem?
Any backend service that has Spring Security will issue redirects and the Location header will contain the backend URI instead of the gateway URI.
Spencer Gibb
@spencergibb
Feb 21 2017 16:36
@kanderson450 you'll need to write a filter.
Kyle Anderson
@andersonkyle
Feb 21 2017 16:38
@spencergibb Right. I just wasn't sure how exactly to rewrite the Location of the Backend service with that of the Gateway.
I should clarify, I believe I can rewrite the Location of the response, but how can I infer the Location of the Gateway?
So that I know what to rewrite it with... That seems to be the missing piece for me.
Spencer Gibb
@spencergibb
Feb 21 2017 16:40
the incoming request should have that information
Kyle Anderson
@andersonkyle
Feb 21 2017 16:41
Okay, I'll take a closer look. Thanks.
Ben
@madorb
Feb 21 2017 17:18
is there a particular reason that setting: spring.cloud.config.enabled=false should cause the applicaiton to fail bootstrapping unless spring.cloud.config.discovery.enabled=false? Specifically it fails autowiring a Discovery client into DiscoveryClientConfigServiceBootstrapConfiguration but it seems to me like the former should take precedence over the latter? unless i’m misunderstanding the intent
Dave Syer
@dsyer
Feb 21 2017 17:19
spring.cloud.config.discovery.enabled=false is the default
I'd expect you'd have to unset it if you have it explicitly set to "true"
Ben
@madorb
Feb 21 2017 17:19
ah, yes, you’re correct
i’m tryign to disable it for a specific profile
though, i’d argue that the DiscoveryClientConfigServiceBootstrapConfigurationshould also be conditional on whether the overall config is enabled or not
Dave Syer
@dsyer
Feb 21 2017 17:20
I guess you could make that argument
You could send a PR if you care enough
Ben
@madorb
Feb 21 2017 17:21
i will do just that, just wanted to make sure i wasn’t misunderstanding something, thanks much @dsyer
Ben
@madorb
Feb 21 2017 21:37
just got to looking at it - i forgot that @ConditionalOnPropertyis not repeatable, so I suppose I’m out of luck :-)
Marcin Grzejszczak
@marcingrzejszczak
Feb 21 2017 21:39
@madorb I don't know what the problem is but you can create an annotation that is annotated with @ConditionalOnProperty - that way you can repeat it
Ben
@madorb
Feb 21 2017 21:41
eh, that seems like it’s not worth the effort, see the exchange directly above that I had with dave syer - basically i had a misconfiguration and realized that a "global disable” flag was not actually overriding a “local enable” flag. Bad configuration on my part, but doesn’t could easily be ignored, but adding a special annotation just for that seems kinda meh
Marcin Grzejszczak
@marcingrzejszczak
Feb 21 2017 21:50
ah ok - like I said I read only the last sentence ;)