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

17th
Jan 2017
Simonfld
@Simonfld
Jan 17 2017 02:03
@spencergibb could you tell me which zuul support long lived connections ??
does zuul 2.x support ??
Spencer Gibb
@spencergibb
Jan 17 2017 02:04
Netflix has said 2.x will support them in the future
Simonfld
@Simonfld
Jan 17 2017 02:05
it mean now 2.x also did't support them, right ?
Spencer Gibb
@spencergibb
Jan 17 2017 02:05
that is correct. 2.x has not been formally released either
Simonfld
@Simonfld
Jan 17 2017 02:06
oh, my god...
Thanks for you help @spencergibb
Aleksandr Tarasov
@aatarasoff
Jan 17 2017 08:40
Hi, guys! I'm developing experimental integration between Marathon framework for Apache Mesos and Spring Cloud (https://github.com/aatarasoff/spring-cloud-marathon). Motivation is the same as in the project for Kubernetes (https://github.com/spring-cloud-incubator/spring-cloud-kubernetes). To use the first-class source that keeps configuration for discovery and load balancing. If anybody wants to help or test it, you are welcome.
saleemps24
@saleemps24
Jan 17 2017 12:49
Zuul is sending multiple request after default timeout. How can we solve this issue
Achilleas Naoumidis
@anaumidis
Jan 17 2017 15:46
Hello! I have this setup {Internet -> Apache(Reverse Proxy) -> Zuul(Reverse Proxy) -> SpringMVC API}. In my API I build a link to a RestController method with linkTo(methodOn()).toUri() and the following exception is thrown: java.net.URISyntaxException: Illegal character in scheme name at index 4: null%2Chttp://... (the rest of the url is ommited). Does anyone have an idea why this would happening ? All the components of the pipeline seem to be working perfectly when run individually, but when combined together they seem to be causing this exception. And Zuul with SpringMVC API are working perfectly fine too.
Achilleas Naoumidis
@anaumidis
Jan 17 2017 16:04
For some reason something append the null, char sequence to the start of the url.
Dave Syer
@dsyer
Jan 17 2017 16:11
Looks like an encoded CSV
Avanish Pathak
@5punk
Jan 17 2017 17:48
@dsyer I understand, what I am trying to find out is how do I amalgamate / join the spring cloud config values with my current local config properties files.
Right now, it's not resolving my cloud config values, it just spits out 0 for all values that should exist.
My service-context.xml has a PropertyPlaceHolder bean, which dictates multiple locations to pick up .properties files from, what I am trying to find out is can I add Cloud-Config as another location?
Dave Syer
@dsyer
Jan 17 2017 18:18
That doesn't sound like a spring boot app
Avanish Pathak
@5punk
Jan 17 2017 18:49
It is....
The problem is @Value is resolving values from my local config files.
NOT my cloud config values.
I have added @RefreshScope
I managed to change the server.port from github config files. So I know it's connected and working right.
Patrick Cornelißen
@pcornelissen
Jan 17 2017 18:52
why do you use xml files to configure spring? I am so glad that we don’t have to do this anymore ;)
Avanish Pathak
@5punk
Jan 17 2017 18:53
I know.... I am moving it out of that and to the cloud. :)
A .yml file in the cloud should suffice.
I wanna be able to add multiple propertySources too.
Patrick Cornelißen
@pcornelissen
Jan 17 2017 18:55
the yml files are the new property files, but why do you configure your context in xml? that seems painful
Avanish Pathak
@5punk
Jan 17 2017 18:55
It is.
I've this stupid bean here
<bean id="propertyConfigurer" class="com.test.platform.sp.spring.PropertiesUtilities">
        <property name="locations">
            <list>
                <!-- Sequence of these files matter. Properties defined in later files 
                    will overwrite those loaded previously -->
                <!-- Default baseline config properties -->
                <value>classpath:/config/common.properties</value>
                <value>classpath:/config/config.properties</value>
                <value>classpath:build-info.properties</value>
                <value>classpath:/config/${app.env}.properties</value>
                <!-- The config.override.path is determined at build time and can be 
                    injected in the pom.xml. e.g.: A war build profile may have "${catalina.base}/conf" 
                    but local jar build may be "file:./conf" -->
                <value>${config.override.path}/config-override.properties</value>
            </list>
        </property>
        <property name="ignoreResourceNotFound" value="true" />
    </bean>
Which is what I'm trying to get rid of.
This file amalgamates all the .properties files you can see listed up there.
Into one single importable source.
Which is what the SCOPE of @Value() is referring, instead of the cloud config values.
Patrick Cornelißen
@pcornelissen
Jan 17 2017 18:56
this can also be set via annotations
Avanish Pathak
@5punk
Jan 17 2017 18:56
You see my issue?
I wanna rid all my local config files and move them to the cloud, that's my end game.
Patrick Cornelißen
@pcornelissen
Jan 17 2017 18:57
with the configserver I assume
Avanish Pathak
@5punk
Jan 17 2017 18:57
Yes yes!
Patrick Cornelißen
@pcornelissen
Jan 17 2017 18:59
I use the configserver with a local property directory (local to the service) and i have the yamls files there (correctly named property files work too) then you just need athe server running and bootstrap.yaml in the client services + the correct set of maven/gradle dependencies
that should be it
Avanish Pathak
@5punk
Jan 17 2017 19:00
Yup, this is what my bootstrap.yml looks like
spring:
  application:
    name: test-app
  cloud:
    config:
      uri: http://localhost:8888
Patrick Cornelißen
@pcornelissen
Jan 17 2017 19:00
I’d suggest some tweaks
` spring:
application:
name: registration
cloud:
config:
enabled: true
failFast: true
retry:
max-attempts: 60
discovery:
enabled: false
uri: ${vcap.services.configserver.credentials.uri:http://admin:s3cr3t!S@dockermachine:8888}
Avanish Pathak
@5punk
Jan 17 2017 19:01
Where do you get this value from vcap.services.configserver.credentials.uri?
Patrick Cornelißen
@pcornelissen
Jan 17 2017 19:01
this is for some cloud deployments
Avanish Pathak
@5punk
Jan 17 2017 19:01
Like, the config loads fine, I can change the server.port just fine.
And it reflects fine when I restart my app.
Just the SCOPE of my @Value() annotation doesn't reference the cloud config yml file.
Which is why I am here. :)
Patrick Cornelißen
@pcornelissen
Jan 17 2017 19:02
the enabled: true, failfast etc. is important in my deployments and as I use eureka usually I have to disable service discovery of the server
Avanish Pathak
@5punk
Jan 17 2017 19:02
Yup.
I will add it.
Patrick Cornelißen
@pcornelissen
Jan 17 2017 19:02
I think you need to notify the server (configserver-client)
Avanish Pathak
@5punk
Jan 17 2017 19:03
But can you help me fix my scope? Or add the cloud config values to the amalgamation or joint config values?
Can I define a new location in the bean I've dumped up?
Patrick Cornelißen
@pcornelissen
Jan 17 2017 19:03
did you call the refresh endpoint of teh actuator plugin?
Avanish Pathak
@5punk
Jan 17 2017 19:03
Yes.
Patrick Cornelißen
@pcornelissen
Jan 17 2017 19:03
ah ok, hmm it „should“ work in this case I think
Avanish Pathak
@5punk
Jan 17 2017 19:03
Like I said, I can change the Tomcat Server's port from the github .yml file.
Precisely.
Patrick Cornelißen
@pcornelissen
Jan 17 2017 19:04
although i’m not sure if you can easily change the port at runtime
Avanish Pathak
@5punk
Jan 17 2017 19:04
I am guessing there's an issue cause of service-context.yml
Not at runtime sir :)
<bean id="propertyConfigurer" class="com.test.platform.sp.spring.PropertiesUtilities">
        <property name="locations">
            <list>
                <!-- Sequence of these files matter. Properties defined in later files 
                    will overwrite those loaded previously -->
                <!-- Default baseline config properties -->
                <value>classpath:/config/common.properties</value>
                <value>classpath:/config/config.properties</value>
                <value>classpath:build-info.properties</value>
                <value>classpath:/config/${app.env}.properties</value>
                <!-- The config.override.path is determined at build time and can be 
                    injected in the pom.xml. e.g.: A war build profile may have "${catalina.base}/conf" 
                    but local jar build may be "file:./conf" -->
                <value>${config.override.path}/config-override.properties</value>
            </list>
        </property>
        <property name="ignoreResourceNotFound" value="true" />
    </bean>
Is there a way to add a <value> for cloud config?
Patrick Cornelißen
@pcornelissen
Jan 17 2017 19:05
well, I guess that is a good question for dave :-)
Avanish Pathak
@5punk
Jan 17 2017 19:17
@dsyer
Avanish Pathak
@5punk
Jan 17 2017 19:23
I am hoping there's an annotation I can use to explicitly state that this Class should load the cloud config for @Value instead of local config values.
Spencer Gibb
@spencergibb
Jan 17 2017 19:25
@5punk unfortunatly you’ve too diverged from the normal way boot works. Spring Boot naturally uses the Spring Enivironment to combine sources.
Avanish Pathak
@5punk
Jan 17 2017 19:44
Yes, I understand. Which is why I am moving everything to spring-cloud.
Spencer Gibb
@spencergibb
Jan 17 2017 19:45
I don’t know how to plug spring-cloud-config into your bean defined above
Avanish Pathak
@5punk
Jan 17 2017 21:01
:'(
So the only way is to completely nuke my configs and start again?
Patrick Cornelißen
@pcornelissen
Jan 17 2017 21:43
I’d just remove this weird property loading stuff and properly configure the remaining property files via annotations