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

2nd
Sep 2016
David Welch
@dwelch2344
Sep 02 2016 00:38

Ok @spencergibb, riddle me this: in our kubernetes cluster we have a 3-node consul setup. Working great for the most part. However, if we gracefully shut down one of the consul nodes, all services that initially pulled configs from that node start blowing up. It looks like ConfigWatch#watchConfigKeyValues() blows up ~81. The question is why?

I'm guessing the consulClient for the Watcher isn't happy w/ the new box / doesn't have a valid connection / etc. However, since all 3 consul nodes are behind a load balanced service, said consulClient should be able to use the same URL as before (and hit something healthy)

Stack trace generated is pretty straight forward. Looks like the KV response is straight up null (from the client lib). I know that's an external dependency, but is there / should there be a way to recover from this?

2016-09-02 00:13:53.748 [LEVEL=ERROR] [IID=dev-users-vhehz::1] [IUID=][ITENANT=][IURL=]          o.s.c.c.config.ConfigWatch               -      Error initializing listener for context config/users/

com.ecwid.consul.v1.OperationException: null
       at com.ecwid.consul.v1.kv.KeyValueConsulClient.getKVValues(KeyValueConsulClient.java:159) ~[consul-api-1.1.9.jar!/:na]
       at com.ecwid.consul.v1.kv.KeyValueConsulClient.getKVValues(KeyValueConsulClient.java:143) ~[consul-api-1.1.9.jar!/:na]
       at com.ecwid.consul.v1.ConsulClient.getKVValues(ConsulClient.java:399) ~[consul-api-1.1.9.jar!/:na]
       at org.springframework.cloud.consul.config.ConfigWatch.watchConfigKeyValues(ConfigWatch.java:81) ~[spring-cloud-consul-config-1.0.0.RELEASE.jar!/:1.0.0.RELEASE]
       at sun.reflect.GeneratedMethodAccessor137.invoke(Unknown Source) ~[na:na]
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_74]
       at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_74]
       at org.springframework.scheduling.support.ScheduledMethodRunnable.run(ScheduledMethodRunnable.java:65) [spring-context-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
       at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-4.2.4.RELEASE.jar!/:4.2.4.RELEASE]
       at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_74]
       at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308) [na:1.8.0_74]
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180) [na:1.8.0_74]
       at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294) [na:1.8.0_74]
       at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [na:1.8.0_74]
       at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [na:1.8.0_74]
       at java.lang.Thread.run(Thread.java:745) [na:1.8.0_74]
Niklas Herder
@herder
Sep 02 2016 08:33
Hi, I'm using @EnableTurbine together with Eureka to gather Hystrix streams, but Turbine doesn't seem to use the management port when trying to get the hystrix.stream, but uses the homePageUrl. Is there any way to configure this?
Found hosts that have been previously terminated: 0 2016-09-02 08:21:12.923 INFO 26093 --- [ Timer-0] c.n.t.discovery.InstanceObservable : Hosts up:2, hosts down: 0 2016-09-02 08:21:12.935 INFO 26093 --- [ Timer-0] c.n.t.monitor.instance.InstanceMonitor : Url for host: http://ec2-....eu-central-1.compute.amazonaws.com:8080/hystrix.stream default
Dieter Hubau
@Turbots
Sep 02 2016 09:05
if I had a websocket based, cloud-native web app and I want to send updates over websocket over multiple instances (person A is connected to instance A and person B is connected to instance B), what would I typically use, aiming for speed of delivery
Dieter Hubau
@Turbots
Sep 02 2016 09:27
nevermind, I just found out about the excellent Spring Data Redis PubSub functionality :+1:
Marcin Grzejszczak
@marcingrzejszczak
Sep 02 2016 10:15
@ismorodin can you elaborate more on this? You can have a custom FeignClient impl in which you can catch any exceptions for example
Ivan
@ismorodin
Sep 02 2016 10:17
@marcingrzejszczak But FeignClient is interface!
Marcin Grzejszczak
@marcingrzejszczak
Sep 02 2016 10:17
I meant Feign.Client
Ivan
@ismorodin
Sep 02 2016 10:20
My code example:
@FeignClient(name = "MyClient", url = "http://my-url.com", fallback =MyFeignClientFallback.class)
interface FeignMyClient extends MyClient{

    @RequestMapping(method = GET, value = "/validate")
    MyResponse check(@RequestParam("user") String user, @RequestParam("pass") String pass);
}
Mark Paluch
@mp911de
Sep 02 2016 10:22
@Turbots Redis for performance without persistent messages, AMQP/JMS/Kafka for pub/sub with persistence
Marcin Grzejszczak
@marcingrzejszczak
Sep 02 2016 10:38
@ismorodin you still ahven't explained what you want to do
Jose Armesto
@fiunchinho
Sep 02 2016 12:44
how can I activate basic authentication just for actuator endpoints? If I add spring-security, all my endpoints get secured, but I just want actuator endpoints
Jose Armesto
@fiunchinho
Sep 02 2016 13:05
ok, I got it! :)
Jose Armesto
@fiunchinho
Sep 02 2016 13:22
mm... and how do I secure the hystrix.stream endpoint?