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

6th
Jun 2018
Matt Benson
@mbenson
Jun 06 2018 04:05
spring-cloud/spring-cloud-commons#379
(and yes, I know it's also over in the activity list on the right)
CH4:D
@chad_d_stud_twitter
Jun 06 2018 05:07
@marcosbarbero good day. i’ll look into that. i got called away to do something else
Marcos Barbero
@marcosbarbero
Jun 06 2018 07:17
@chad_d_stud_twitter take your time
and good day for you as well :smile:
vikrantch-hk
@vikrantch-hk
Jun 06 2018 11:39
@ryanjbaxter I am facing same issue as mentioned in spring-cloud/spring-cloud-netflix#2754
using Finchley.M9 with spring boot 2.0.0
I continuously get eureka client is not able to send heartbeat to any known server error
Marcos Barbero
@marcosbarbero
Jun 06 2018 11:46
There's a solution right there @vikrantch-hk
Just follow the PR spring-cloud/spring-cloud-netflix#2992
vikrantch-hk
@vikrantch-hk
Jun 06 2018 12:24
@marcosbarbero thanks I was not able to find documentation earlier
Marcos Barbero
@marcosbarbero
Jun 06 2018 12:25
that's ok, it happens
vikrantch-hk
@vikrantch-hk
Jun 06 2018 12:25
http.csrf().ignoringAntMatchers("/eureka/**");
worked for me
:)
Marcos Barbero
@marcosbarbero
Jun 06 2018 12:25
beautiful!
salaboy
@salaboy
Jun 06 2018 15:04
hi guys.. quick question about spring.cloud.gateway.discovery.locator property
any idea where is that now?
@spencergibb ^
I need to change the url-expression for ribbon to connect
it looks like the value is hardcoded now in DiscoveryClientRouteDefinitionLocator
I’m using M9 of the gateway.. so that might be old?
salaboy
@salaboy
Jun 06 2018 15:10
and that class seems to be impossible to extend :(
Spencer Gibb
@spencergibb
Jun 06 2018 15:13
@Salaboy it is old, but spring.cloud.gateway.discovery.locator.enabled is the property
salaboy
@salaboy
Jun 06 2018 15:13
@spencergibb that’s the one that I was using a month ago.. is that still in the latest released artifact?
Spencer Gibb
@spencergibb
Jun 06 2018 15:14
spring.cloud.gateway.discovery.locator.url-expresion=... should work with RC2
salaboy
@salaboy
Jun 06 2018 15:15
so that is Finchley.RC2 right?
Spencer Gibb
@spencergibb
Jun 06 2018 15:15
yes
salaboy
@salaboy
Jun 06 2018 15:15
weird.. cleaning my maven cache.. because there is something really messed up here
salaboy
@salaboy
Jun 06 2018 15:21
fixed.. some maven clashing with local project
@spencergibb thanks for the confirmation that it should work :)
Joshua Street
@jjstreet
Jun 06 2018 18:12
heyall
i managed to make a somewhat smaller example application suite
that illustraties my trouble with zuul and feign
for my ribbon services that have a list of servers to function with feign, i must specify port numbers
for the same ribbon services that have a list of servers to function with Zuul, i must not specify port numbers
this is for HTTPS on cloud foundry
strangely, im not seeing any indicators of a problem coming from Zuul
like, no exceptions thrown
however, with Feign, the service eventually times out
jprateekvmware
@jprateekvmware
Jun 06 2018 18:32

Spring boot version : 1.5.6.RELEASE</version>

<spring-cloud.version>Edgware.RC1</spring-cloud.version>

java.lang.IllegalStateException: No instances found of configserver (config-server)
when discovered through eureka
is this a know issue ?
@here any advise
Spencer Gibb
@spencergibb
Jun 06 2018 18:59
I would think you should always use port number, otherwise ribbon will guess
Brian Devins-Suresh
@devinsba
Jun 06 2018 19:16
@spencergibb here’s another small fix for aws spring-cloud/spring-cloud-aws#338
Joshua Street
@jjstreet
Jun 06 2018 19:31
@spencergibb it seems wierd that ribbon can guess correctly with Zuul and not with Feign
Spencer Gibb
@spencergibb
Jun 06 2018 19:33
I wouldn't rely on ribbon guessing
Joshua Street
@jjstreet
Jun 06 2018 19:33
i dont want it to either
i would prefer to specify port numbers
i have a sinking feeling im fighting against cloud foundry
specifically, the gorouter
i dont know enough about TLS/SSL and how termination works within our cloud
Joshua Street
@jjstreet
Jun 06 2018 19:40
im suspicious that theres something wrong with how i have Zuul set up
because feign works great with ports
Joshua Street
@jjstreet
Jun 06 2018 19:57
got something useful out of an exception finally:
Caused by: org.apache.http.NoHttpResponseException: messenger-2.apps-cf.company.com:443 failed to respond
in my config i have:
messenger2:
  ribbon:
    IsSecured: true
    listOfServers: https://messenger-2.apps-cf.company.com:443
where did the https:// go?
this kinda relates to another situation i was in earlier last month
if i remove spring-retry
then i must specify a port number for Zuul to function with ribbon.listOfServes
it seems theres something different for the RetryableRibbonLoadBalancingClient that is different than the normal one
i wish i could pinpoint it further with an issue
Joshua Street
@jjstreet
Jun 06 2018 20:15
i've confirmed that the RetryableRibbonLoadBalancingHttpClient tries to use a URI with scheme of http
shouldn't it be https as stated in my listOfServers?
So the problem is that RibbonServer determines the scheme of the URI based on whether it is secure or not
Joshua Street
@jjstreet
Jun 06 2018 20:21
and not based on what listOfServers says
Joshua Street
@jjstreet
Jun 06 2018 20:27
i cant make my service secure
so i can never set it to use https
ive tried IsSecure IsSecured isSecure
Joshua Street
@jjstreet
Jun 06 2018 20:52
bah, i think i got it figured out
the magical combination
hot damn
ribbon:
  IsSecure: true

messenger1:
  ribbon:
    listOfServers: https://messenger-1.cf.company.com:443

messenger2:
  ribbon:
    listOfServers: https://messenger-2.cf.company.com:443
this works with feign and Zuul
Joshua Street
@jjstreet
Jun 06 2018 20:57
Zuul requires that IsSecure is set. Curiously I dont think it worked when individual services are marked secure but i need to try that again
its the only way a RibbonServer that is generated, produces the right URI scheme
the scheme provided in listOfServers is effectively ignored
Feign seems to use the scheme from listOfServers but i haven't confirmed that
Ryan Baxter
@ryanjbaxter
Jun 06 2018 20:59
listOfServers should just include host and port
Joshua Street
@jjstreet
Jun 06 2018 21:00
no scheme?
Joshua Street
@jjstreet
Jun 06 2018 21:00
hrm
i've been staring at this stuff all day... and all last week..
i keep missing the little details it seems
gonna try that now
Ryan Baxter
@ryanjbaxter
Jun 06 2018 21:01
sorry, the example is right there in the documentation
Joshua Street
@jjstreet
Jun 06 2018 21:02
no no, im saying its my fault i missed it because i've been staring at it for too long heh
:)
Ryan Baxter
@ryanjbaxter
Jun 06 2018 21:02
that happes to all of us ;)
Joshua Street
@jjstreet
Jun 06 2018 21:03
another example. here i am wondering why LoadBalancingTarget isn't available in the feign libraries
its deprecated, a little detail i missed heh
this is really great, with this fixed i can use feign again
i was manually reading the listOfServers properties to create restTemplates
so i could my services for some data
it was terribly brittle
feign lets me use ribbon like i can use ribbon with Zuul, much more robust
hot shit! it works
@ryanjbaxter thanks for piping in about the schema
Ryan Baxter
@ryanjbaxter
Jun 06 2018 21:07
great
Joshua Street
@jjstreet
Jun 06 2018 21:07
er scheme
a tangential question to all of this
i'm manually creating feign clients
because i don't know the service name until runtime
i create them the same way as the example documentation
er
nvm, i dont know where i was going with this
Joshua Street
@jjstreet
Jun 06 2018 21:12
??
ill get our code base back to where it was with feign, and confirm all of my findings
i ended up backing out all of the feign stuff before i went on vacation last week. was really bummed
oh, i remembered my question: the ribbon clients that Zuul generates, are they the same ribbon clients the feign would use?
or vice versa
since the client names are the same
it doesn't seem like it
Ryan Baxter
@ryanjbaxter
Jun 06 2018 21:15
not sure what u mean
they can point to the same services
but wont be the same clients if you are using both zuul and feign in the same app
Joshua Street
@jjstreet
Jun 06 2018 21:16
ah
Ryan Baxter
@ryanjbaxter
Jun 06 2018 21:16
however the configuration properties would apply to both
Joshua Street
@jjstreet
Jun 06 2018 21:16
ah
so both my feign clients and zuul refer to hte same ribbon services
Ryan Baxter
@ryanjbaxter
Jun 06 2018 21:17
no
well actually maybe
are you using feign and zuul in the same app
Joshua Street
@jjstreet
Jun 06 2018 21:17
aye
i am
Ryan Baxter
@ryanjbaxter
Jun 06 2018 21:18
i am not 100% sure actually
Joshua Street
@jjstreet
Jun 06 2018 21:18
our proxy is a bit special
Ryan Baxter
@ryanjbaxter
Jun 06 2018 21:18
they might the more i think about it
Joshua Street
@jjstreet
Jun 06 2018 21:18
our request latency is so different between requests, that we've segregated traffic based on some request data
so i have our proxy proxying requests based on that data to instances of the same microservice
i use feign to poll those instances to find out what they can handle
and zuul handles the request routing based on the data retrieved by polling with feign
i was looking in the code trying to understand how feign uses ribbon so i could see if i was going to have a problem with timeouts being different when using feign, vs using Zuul
with feign i can set timeouts explicitly so theres no problem
but i was still curious about the integration of all these libraries
i've specified my services only 1 time
Ryan Baxter
@ryanjbaxter
Jun 06 2018 21:21
if u are using ribbon for both than it is enough to set the ribbon timeouts
Joshua Street
@jjstreet
Jun 06 2018 21:21
i do set the ribbon timeouts
for Zuul
i then make the timeouts a bit shorter for feign, since i know those calls should complete much quicker
Ryan Baxter
@ryanjbaxter
Jun 06 2018 21:23
the ribbon timeouts would effect both
so i am not sure what u mean by making the feign timeouts shorter
Joshua Street
@jjstreet
Jun 06 2018 21:25
im creating my feign clients manually
public FooClientFactory(
        Feign.Builder feignBuilder,
        Encoder encoder,
        Decoder decoder,
        Client client,
        Contract contract,
        OAuth2FeignRequestInterceptor oAuth2FeignRequestInterceptor) {
    this.feignBuilder = feignBuilder
            .encoder(encoder)
            .decoder(decoder)
            .contract(contract)
            .client(client)
            .options(new Request.Options(CONNECT_TIMEOUT, READ_TIMEOUT))
            .requestInterceptor(oAuth2FeignRequestInterceptor);
}
the Request.Options are overriding whatever ribbon is set with i found out in some basic testing
public FooFeignClient create(String serviceId) {
    return this.feignBuilder.target(FooFeignClient.class, "http://" + serviceId);
}
the Client injected into this factory class is a ribbonclient for feign
Contract is the MvcContract from spring to read the right annotations
the Feign.Builder should be the Hystrix based one since hystrix is on the class path
it works well at least right now with no server failures and the circuit breaker forced closed
Joshua Street
@jjstreet
Jun 06 2018 21:31
So i am pretty sure feign is choosing ServerInstance's much in the same way Zuul is since they both use ribbon
at least it seems logical that feign uses ribbon in a way similar to Zuul
it is my hope that it does
so that either Zuul or Feign can trip the circuit breaker and both fiegn and Zuul react accordingly due to ribbon avoiding that server for a period of time
alright, ive done enough. thanks to anyone who listened and piped in, i appreciate it