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

5th
Sep 2017
Josh Long
@joshlong
Sep 05 2017 02:30
hi. Suppose a Eureka client is unnaturally killed and doesnt get a chance to disconnect from Eureka. Theres a heartbeat from the service that eventually reaps that orphaned record. What value configures the heartbeat interval? How do i make that smaller?
Tommy Ludwig
@shakuzen
Sep 05 2017 02:42
@joshlong I think it is mentioned in this section of the documentation with a warning that is greatly elaborated on in spring-cloud/spring-cloud-netflix#373
tl;dr: I believe eureka.instance.leaseRenewalIntervalInSeconds will do what you want, but with potential (undesirable) side-effects.

Though reading through that issue, maybe eureka.instance.leaseExpirationDurationInSeconds is what you want per:

During demo/development, if you want to detect "dead" instances quicker, I would suggest to play with the eureka.instance.leaseExpirationDurationInSeconds parameter instead. The value is set to 90s by default, which means a lease is expired after 3 consecutive missing heartbeats. This is of course pretty long during demo/dev, but you can always lower it to 30s - and this won't affect the self-protection feature.

cloorc
@cloorc
Sep 05 2017 11:46
Hi guys, how could I get the latest pdf release of spring cloud reference instead of html?
I found it did not have an pdf release version, how could I get or generate it?
Marcin Grzejszczak
@marcingrzejszczak
Sep 05 2017 12:03
we do not publish the docs as PDF
you can print the HTML as PDF
cloorc
@cloorc
Sep 05 2017 12:42
Ok, what a pity! Spring Boot does a great job for releasing a pdf version too.
Thanks anyway!
Marcin Grzejszczak
@marcingrzejszczak
Sep 05 2017 12:43
yup, we're deploying to gh-pages, that's why we've decided no to do the PDF version
cloorc
@cloorc
Sep 05 2017 12:43
:+1:
Marcin Grzejszczak
@marcingrzejszczak
Sep 05 2017 12:43
I guess if more people get interested in the topic we can back to it. You're the first person to ask about this (at least to the best of my knowledge) for the last almost 2 years ;)
cloorc
@cloorc
Sep 05 2017 12:45
Hmm, actually I need to read it at my tablet without internet connection.
Of course the gh-pages are already good enough for reading on a computer.
Marcin Grzejszczak
@marcingrzejszczak
Sep 05 2017 12:47
yeah so if I were you I'd print them as a PDF or just open them earlier when you have the internet :/
cloorc
@cloorc
Sep 05 2017 12:48
Yes, I'm afraid this is the only solution for me recently.
Thanks ! :smile:
Marcin Grzejszczak
@marcingrzejszczak
Sep 05 2017 12:49
np
Oleg Sukhov
@oleg-sukhov
Sep 05 2017 15:30
Hi everyone. I'm trying to play a little bit with spring cloud and heroku. I've deployed a couple of services (Spring Boot apps) on heroku - discovery service(Eureka), config service, api-gateway service and my custom service. When I open Eureka I see all the services in, but they have like this 2c328147-2c34-48bc-afc9-5377b447f8dc.prvt.dyno.rt.heroku.com:config-service:48304, and when I try to open the mentioned url I'm getting the 404. Instead of that I can open the service by the following url <service_name>.herokuapp.com. Can someone explain me how to configure eureka service to use correct service url?
Dave Syer
@dsyer
Sep 05 2017 15:32
It's the same in Cloud Foundry
Look in the user guide for guidance on "Changing the Eureka Instance ID"
and "Using Eureka on Cloudfoundry"
Oleg Sukhov
@oleg-sukhov
Sep 05 2017 15:54
Thanks @dsyer . I've tried to change the eureka instance by setting the following property eureka.instance.hostname=https://<service-id>.herokuapp.com/
but it will not help
Dave Syer
@dsyer
Sep 05 2017 15:55
That's not a hostname, it's a URI
Oleg Sukhov
@oleg-sukhov
Sep 05 2017 15:57
As I understood Cloud Foundry provides the specific variables for this purpose
Dave Syer
@dsyer
Sep 05 2017 16:01
Yes.
Heroku probably does too.
But there's nothing to stop you creating your own
Oleg Sukhov
@oleg-sukhov
Sep 05 2017 16:05
Maybe I'm doing something wrong. The reason why I'm trying to change the service instance id is because my balancer can't find my service by such uri - (2c328147-2c34-48bc-afc9-5377b447f8dc.prvt.dyno.rt.heroku.com:config-service:48304). I'm getting the following exception
2017-09-05T16:04:23.148601+00:00 app[web.1]: Caused by: com.netflix.client.ClientException: null
2017-09-05T16:04:23.148602+00:00 app[web.1]:     at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:123) ~[ribbon-loadbalancer-2.2.2.jar!/:2.2.2]
2017-09-05T16:04:23.148603+00:00 app[web.1]:     at org.springframework.cloud.netflix.zuul.filters.route.support.AbstractRibbonCommand.run(AbstractRibbonCommand.java:105) ~[spring-cloud-netflix-core-1.3.0.RELEASE.jar!/:1.3.0.RELEASE]
2017-09-05T16:04:23.148604+00:00 app[web.1]:     at org.springframework.cloud.netflix.zuul.filters.route.support.AbstractRibbonCommand.run(AbstractRibbonCommand.java:43) ~[spring-cloud-netflix-core-1.3.0.RELEASE.jar!/:1.3.0.RELEASE]
2017-09-05T16:04:23.148604+00:00 app[web.1]:     at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:302) ~[hystrix-core-1.5.10.jar!/:1.5.10]
2017-09-05T16:04:23.148605+00:00 app[web.1]:     at com.netflix.hystrix.HystrixCommand$2.call(HystrixCommand.java:298) ~[hystrix-core-1.5.10.jar!/:1.5.10]
2017-09-05T16:04:23.148606+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:46) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148606+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148607+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148608+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148609+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148609+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148610+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148610+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148611+00:00 app[web.1]:     at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148612+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:51) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148612+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeDefer.call(OnSubscribeDefer.java:35) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148613+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148613+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148614+00:00 app[web.1]:     at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148614+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148615+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148619+00:00 app[web.1]:     at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148619+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:41) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148620+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeDoOnEach.call(OnSubscribeDoOnEach.java:30) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148620+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148621+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLi
Dave Syer
@dsyer
Sep 05 2017 16:08
Yeah, well that's the hostname that the JDK thinks it is running in. It means you haven't configured eureka.instance.hostname.
Oleg Sukhov
@oleg-sukhov
Sep 05 2017 16:09
Caused by: java.lang.RuntimeException: org.apache.http.conn.HttpHostConnectException: Connect to 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com:22974 [35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/50.19.219.12, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/50.19.241.114, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/54.204.41.187, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/54.225.172.80, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/54.225.175.159, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/54.235.104.245, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/50.17.200.61, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/50.17.232.145] failed: Connection refused (Connection refused)
2017-09-05T16:04:23.148670+00:00 app[web.1]:     at rx.exceptions.Exceptions.propagate(Exceptions.java:58) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148670+00:00 app[web.1]:     at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:465) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148671+00:00 app[web.1]:     at rx.observables.BlockingObservable.single(BlockingObservable.java:342) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:04:23.148672+00:00 app[web.1]:     at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:117) ~[ribbon-loadbalancer-2.2.2.jar!/:2.2.2]
2017-09-05T16:04:23.148673+00:00 app[web.1]:     ... 130 common frames omitted
2017-09-05T16:04:23.148678+00:00 app[web.1]: Caused by: org.apache.http.conn.HttpHostConnectException: Connect to 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com:22974 [35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/50.19.219.12, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/50.19.241.114, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/54.204.41.187, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/54.225.172.80, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/54.225.175.159, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/54.235.104.245, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/50.17.200.61, 35129a54-0cbf-47ea-b3c6-3647fb1b3aea.prvt.dyno.rt.heroku.com/50.17.232.145] failed: Connection refused (Connection refused)
2017-09-05T16:04:23.148679+00:00 app[web.1]:     at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:159) ~[httpclient-4.5.3.jar!/:4.5.3]
2017-09-05T16:04:23.148680+00:00 app[web.1]:     at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359) ~[httpclient-4.5.3.jar!/:4.5.3]
2017-09-05T16:04:23.148681+00:00 app[web.1]:     at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381) ~[httpclient-4.5.3.jar!/:4.5.3]
Dave Syer
@dsyer
Sep 05 2017 16:33
Same problem
Oleg Sukhov
@oleg-sukhov
Sep 05 2017 16:34
@dsyer after setting the property you suggested like this eureka.instance.hostname = ffkr-discovery-service.herokuapp.com(in the Eureka server config) I'm getting the following exception.
2017-09-05T16:31:04.899070+00:00 app[web.1]: Caused by: com.netflix.client.ClientException: Load balancer does not have available server for client: tournament-service
2017-09-05T16:31:04.899070+00:00 app[web.1]:     at com.netflix.loadbalancer.LoadBalancerContext.getServerFromLoadBalancer(LoadBalancerContext.java:483) ~[ribbon-loadbalancer-2.2.2.jar!/:2.2.2]
2017-09-05T16:31:04.899071+00:00 app[web.1]:     at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:184) ~[ribbon-loadbalancer-2.2.2.jar!/:2.2.2]
2017-09-05T16:31:04.899071+00:00 app[web.1]:     at com.netflix.loadbalancer.reactive.LoadBalancerCommand$1.call(LoadBalancerCommand.java:180) ~[ribbon-loadbalancer-2.2.2.jar!/:2.2.2]
2017-09-05T16:31:04.899072+00:00 app[web.1]:     at rx.Observable.unsafeSubscribe(Observable.java:10211) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:31:04.899072+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:94) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:31:04.899073+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:42) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:31:04.899073+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:31:04.899074+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:31:04.899074+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:31:04.899074+00:00 app[web.1]:     at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:31:04.899075+00:00 app[web.1]:     at rx.Observable.subscribe(Observable.java:10307) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:31:04.899075+00:00 app[web.1]:     at rx.Observable.subscribe(Observable.java:10274) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:31:04.899076+00:00 app[web.1]:     at rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:445) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:31:04.899076+00:00 app[web.1]:     at rx.observables.BlockingObservable.single(BlockingObservable.java:342) ~[rxjava-1.1.10.jar!/:1.1.10]
2017-09-05T16:31:04.899077+00:00 app[web.1]:     at com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:117) ~[ribbon-loadbalancer-2.2.2.jar!/:2.2.2]
2017-09-05T16:31:04.899078+00:00 app[web.1]:     at org.springframework.cloud.netflix.zuul.filters.route.support.AbstractRibbonCommand.run(AbstractRibbonCommand.java:105) ~[spring-cloud-netflix-core-1.3.0.RELEASE.jar!/:1.3.0.RELEASE]
2017-09-05T16:31:04.899078+00:00 app[web.1]:     at org.springframework.cloud.netflix.zuul.filters.route.support.AbstractRibbonCommand.run(AbstractRibbonCommand.java:43) ~[spring-cloud-netflix-core-1.3.0.RELEASE.jar!/:1.3.0.RELEASE]
Dave Syer
@dsyer
Sep 05 2017 16:43
But you have to set the instance info in the instance (not the eureka server), don't you?
Each service instance registers itself with eureka. It has to send a hostname.
Dave Syer
@dsyer
Sep 05 2017 21:09
Extending WebMvcConfigurationSupport is an odd thing to do. But that doesn't answer the question.
A minimal sample would probably help narrow it down
Gilles Robert
@ask4gilles
Sep 05 2017 21:11
indeed ;-) I'll try to provide one! thanks
Gilles Robert
@ask4gilles
Sep 05 2017 22:02
@dsyer was probably related to something else but extending WebMvcConfigurerAdapter instead fixed it... thank you for the hint!