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

6th
Mar 2019
Patrick Gotthard
@PatrickGotthard
Mar 06 06:15
@spencergibb I've read the whole reference documentation (here and there a few more detailed examples and explanations in the docs would be great) and did some research on the web but found nothing that gives me a hint how to implement our requirement. With Zuul we just had to add this configuration:
zuul:
  routes:
    new-service-name: /old-service-name/**
Ashok Koyi
@thekalinga
Mar 06 06:44
@spencergibb One question reg. ribbon. Since ribbon is only used for finding the server info, all the properties of ribbon that deals with retry count will be of no use in the latest evrsion fo spring cloud. Is that correct?
Patrick Gotthard
@PatrickGotthard
Mar 06 06:50
@tkvangorder First we've tried Zuul but finally switched to spring-cloud-gateway because it supports websockets and it seems that there are no plans to support Zuul 2 in the future. Your Zuul configuration is nearly the same that we used. But as far as I understand spring-cloud-gateway does not support to retry PUT and POST requests at all. So we unregister our service from eureka, wait until the gateway should route no more requests to the instance and then shut down the service gracefully. That seems to be the cleanest solution to us.
gourav goel
@gouravgoel44_twitter
Mar 06 11:11

Hi All,
With refrence to this from Mark Corkery @KramKroc Mar 06 2018 19:23
Hi folks, I posted yesterday about a problem I’ve encountered when jumping from Camden to Edgware.SR2 and our api-gateway. Our gateway uses a combination of RestTemplate + zuul routes. We have some ribbon configuration in place for some of those routes. After further testing I found that the RestTemplate calls were still working as expected, but the zuul routes were all having issues with RibbonLoadBalancingHttpClient as I pasted yesterday:

2018-03-05T16:15:36,766 traceId=cbf29614a3d887d3 spanId=b69050847775e0f5 [qtp808653065-32] WARN o.s.c.n.z.f.p.SendErrorFilter : Error during filtering
com.netflix.zuul.exception.ZuulException: Failed to instantiate [org.springframework.cloud.netflix.ribbon.apache.RibbonLoadBalancingHttpClient]: Is it an abstract class?; nested exception is java.lang.InstantiationException: org.springframework.cloud.netflix.ribbon.apache.RibbonLoadBalancingHttpClient
at org.springframework.cloud.netflix.zuul.util.ZuulRuntimeException.<init>(ZuulRuntimeException.java:33) ~[spring-cloud-netflix-core-1.4.3.RELEASE.jar!/:1.4.3.RELEASE]
at org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter.run(RibbonRoutingFilter.java:119) ~[spring-cloud-netflix-core-1.4.3.RELEASE.jar!/:1.4.3.RELEASE]
Today, I changed one configuration value and that was to set

ribbon.restclient.enabled=true

I am also facing same issue and i am upgrading to finchley and boot 2.0.6
i got exception Caused by: java.lang.ClassCastException: org.springframework.beans.BeanInstantiationException cannot be cast to com.netflix.zuul.exception.ZuulException
at org.springframework.cloud.netflix.zuul.filters.post.SendErrorFilter.findZuulException(SendErrorFilter.java:104)
at org.springframework.cloud.netflix.zuul.filters.post.SendErrorFilter.run(SendErrorFilter.java:73)
at com.netflix.zuul.ZuulFilter.runFilter(ZuulFilter.java:117)
at com.netflix.zuul.FilterProcessor.processZuulFilter(FilterProcessor.java:193)
... 128 common frames

I got this exception cause by debugging as well.
and i got reason for this exception as Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.cloud.netflix.ribbon.apache.RibbonLoadBalancingHttpClient]: Is it an abstract class?; nested exception is java.lang.InstantiationException: org.springframework.cloud.netflix.ribbon.apache.RibbonLoadBalancingHttpClient
so added above mention property to true.
now everything is working fine
but still there is one issue which i am facing
that after setting ribbon.restclient.enabled=true
For PATCH request through api-gateway i got 405
I searched and get to know Netflix Ribbon HTTP client: Enabled by setting ribbon.restclient.enabled=true. This client has limitations, including that it does not support the PATCH method, but it also has built-in retry.
so any help to resolve above mentioned issue?
thanks in advance
Sarvesh Dubey
@Sarvesh-D
Mar 06 16:05
Hi, is there any property in spring cloud config server for caching the properties on bootstrap? For git backend there is some property like spring.cloud.config.git.clone-on-startup, but we are using jdbc as backend..
Ashok Koyi
@thekalinga
Mar 06 21:25

@spencergibb One question reg. ribbon. Since ribbon is only used for finding the server info, all the properties of ribbon that deals with retry count will be of no use in the latest evrsion fo spring cloud. Is that correct?

If true, then how does ribbon track the success & failure rates, response time, e.t.c inorder for it to apply appropriate rules when chosing next instance for a given service id

Appreciate if you can give the class responsible for tracking the latency from ribbon + sprign cloud in the latest version
I'll do further digging there