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

28th
Sep 2016
Dreampie
@Dreampie
Sep 28 2016 03:16
why cloud project not work
2016-09-28 11:07:51.621  INFO 11 --- [           main] b.c.PropertySourceBootstrapConfiguration : Located property source: CompositePropertySource [name='configService', propertySources=[MapPropertySource [name='file://root/cloud-config/user-service-provider.yml'], MapPropertySource [name='file://root/cloud-config/application.yml']]]
2016-09-28 11:07:55.098  WARN 11 --- [           main] o.s.c.a.ConfigurationClassPostProcessor  : Cannot enhance @Configuration bean definition 'refreshScope' since its singleton instance has been created too early. The typical cause is a non-static @Bean method with a BeanDefinitionRegistryPostProcessor return type: Consider declaring such methods as 'static'.
2016-09-28 11:07:59.043  WARN 11 --- [           main] io.undertow.websockets.jsr               : UT026009: XNIO worker was not set on WebSocketDeploymentInfo, the default worker will be used
2016-09-28 11:07:59.045  WARN 11 --- [           main] io.undertow.websockets.jsr               : UT026010: Buffer pool was not set on WebSocketDeploymentInfo, the default pool will be used
2016-09-28 11:08:08.327  WARN 11 --- [           main] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
2016-09-28 11:08:13.707  WARN 11 --- [           main] c.n.c.sources.URLConfigurationSource     : No URLs will be polled as dynamic configuration sources.
damozhiying
@damozhiying
Sep 28 2016 07:39

@RequestMapping("/reDirect")
public String reDirect(HttpServletRequest request) {

ZuulRoute route_cy=new ZuulRoute();
route_cy.setId("erp_cy");
route_cy.setPath("/erp_cy/**");
route_cy.setUrl("http://169.254.50.169:8081");

discoveryClientRouteLocator.addRoute(route_cy);

ZuulRoute route_gwzx=new ZuulRoute();
route_gwzx.setId("erp_gwzx");
route_gwzx.setPath("/erp_gwzx/**");
route_gwzx.setUrl(" http://localhost:9000");

discoveryClientRouteLocator.addRoute(route_gwzx);

String id=request.getSession().getId();


return "redirect:/erp_gwzx/";

}

above code run in ui gateway but can't work well ,the error is 404(above route_cy,route_gwzx can't be config in application.yml because the route info is dynamic,we don't know before the ui gateway startup )
Dave Syer
@dsyer
Sep 28 2016 08:29
@Dreampie it looks normal to me (just warnings)
Dreampie
@Dreampie
Sep 28 2016 08:29
yes, why print warning?
Dave Syer
@dsyer
Sep 28 2016 08:31
Well none of them are in spring-cloud, so why don't you ask the projects that log the warnings (spring-framework, undertow, and netflix archaius, by the looks of it)?
Dreampie
@Dreampie
Sep 28 2016 08:33
... I set logging level was warn,console logging only this,so I think some wrong with me
and other question, Zuul with ssl: How can store keystore.jks in git with spring cloud config server?
Dave Syer
@dsyer
Sep 28 2016 09:02
The config server has a binary file endpoint
You'd have to use that
Dreampie
@Dreampie
Sep 28 2016 11:20
@dsyer thank you,Where to find documents?
Stephan L
@stephlag
Sep 28 2016 11:24
@spencergibb When do you think spring cloud netflix 1.2.1 with fix for spring-cloud/spring-cloud-netflix#1150 will be released?
btw I know there is a workaround for Camden but I think users should be warned that they may face a performance hit using Camden.RELEASE
Dreampie
@Dreampie
Sep 28 2016 11:34

@dsyer

zuul:
  prefix: /api
  routes:
    aservice: /aservice/**
    bservice: /bservice/**

url /api/aservice/a forward is /a?

Dave Syer
@dsyer
Sep 28 2016 11:37
It not a forward, it's a reverse proxy HTTP call
And I think the default is to strip prefixes, so yes, /a is the downstream path
Dreampie
@Dreampie
Sep 28 2016 11:38
aservice is contextPath how can strip?
Dave Syer
@dsyer
Sep 28 2016 11:39
It is stripped by default isn't it?
Dreampie
@Dreampie
Sep 28 2016 11:41
zuul:
  routes:
    aservice: /aservice/**
    bservice: /bservice/**
if config this, not strip aservice
Dreampie
@Dreampie
Sep 28 2016 11:47

http://projects.spring.io/spring-cloud/spring-cloud.html#_router_and_filter_zuul

application.yml
 zuul:
  routes:
    users: /myusers/**

This means that http calls to "/myusers" get forwarded to the "users" service (for example "/myusers/101" is forwarded to "/101").

stripPrefix: false save this,but if need prefix: /api, how todo?
@dsyer
will lost /api?
Dave Syer
@dsyer
Sep 28 2016 12:03
I don't know. You can read the source code as easily as I can. Why don't you have a look and report back?
Dreampie
@Dreampie
Sep 28 2016 12:13
The document did not describe the situation I mentioned, if it said, I went back to see the source code, but now I do not know if this is not deliberately so designed
Dave Syer
@dsyer
Sep 28 2016 12:23
I'm really not sure what you need yet. If you think there's a missing feature, you know what to do though.
that binary file feature you needed in the config server is broken BTW (spring-cloud/spring-cloud-config#517)
Spencer Gibb
@spencergibb
Sep 28 2016 12:43
@stephlag we note that in the release notes. We'll likely do a service release fairly quickly.
damozhiying
@damozhiying
Sep 28 2016 13:12
@spencergibb do you know the answer

Not sure where should I put this question. I have a zuul filter and I am trying to do conditional routing. I am looking for API where I can override route configuration and route the traffic. Example

2 services ( Store and Customer)
If request body has amount greater than $5000, then redirect traffic to Store else customer.
I am stuck and trying to find api on which I can customize routing. I tried ZuulRoute and didn't find how to use in spring cloud.

damozhiying
@damozhiying
Sep 28 2016 13:18

if(price > 5000) {
// Go to service version 1- Customer 1.0

}
else {
// Go to service version 2- Customer 2.0
}

And I want to store and define all route remotely, not in yaml file.

Dreampie
@Dreampie
Sep 28 2016 15:17
@dsyer thanks
pradeepkusingh
@pradeepkusingh
Sep 28 2016 19:13
@dsyer in my config server logs , I am seeing this continuous call to Github
"GET /application/perf
I checked and none of my apps are restarting or trying to get config ....any idea what might cause this call ?
Marcos Barbero
@marcosbarbero
Sep 28 2016 19:32
@pradeepkusingh it may be the configserver health check behavior
pradeepkusingh
@pradeepkusingh
Sep 28 2016 19:33
but why 300+ calls in a minute ?
Marcos Barbero
@marcosbarbero
Sep 28 2016 19:34
it depends on the number of applications you’ve registered
pradeepkusingh
@pradeepkusingh
Sep 28 2016 19:45
hmm..can we reduce the frequency ?
Marcos Barbero
@marcosbarbero
Sep 28 2016 19:51
I’m not sure if there’s a way to reduce it’s frequency, all I know you can disable the configserver healthcheck
pradeepkusingh
@pradeepkusingh
Sep 28 2016 19:51
how ?
how can we disable the configserver health check ?
health.config.enabled=false
is this the one ?
Marcos Barbero
@marcosbarbero
Sep 28 2016 19:54
I think so
if it doesn’t work try with management.health.config.enabled=false
@625096233 I think you can work it out using something like PreDecorationFilter
pradeepkusingh
@pradeepkusingh
Sep 28 2016 19:56
Thank you. let me try
Marcos Barbero
@marcosbarbero
Sep 28 2016 20:13
np!