spring-cloud / spring-cloud-netflix

Integration with Netflix OSS components
http://cloud.spring.io/spring-cloud-netflix/
Apache License 2.0
4.87k stars 2.44k forks source link

Circuit breaker seems not working with new spring version: BOOT: 1.5.3.RELEASE and BOM: Dalston.RELEASE #1900

Closed vyao888 closed 7 years ago

vyao888 commented 7 years ago

I played with some sample using feign (project "feign-test-consumer") and it works with the original versions in pom.xml:

1.2.3.RELEASE 1.2.3.RELEASE 1.4.2.RELEASE

However when I moved to the newer version: BOOT: 1.5.3.RELEASE BOM: Dalston.RELEASE

it failed to run (not able to run the fallback method) with the following error stack (when the only service - "rest-producer" instance is killed):

2017-05-01 12:05:42.629 ERROR 6535 --- [nio-8082-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is feign.RetryableException: Connection refused (Connection refused) executing GET http://localhost:9090/greeting/Cid] with root cause

java.net.ConnectException: Connection refused (Connection refused) at java.net.PlainSocketImpl.socketConnect(Native Method) ~[na:1.8.0_121] at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350) ~[na:1.8.0_121] at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_121] at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_121] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_121] at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_121] at sun.net.NetworkClient.doConnect(NetworkClient.java:175) ~[na:1.8.0_121] at sun.net.www.http.HttpClient.openServer(HttpClient.java:432) ~[na:1.8.0_121] at sun.net.www.http.HttpClient.openServer(HttpClient.java:527) ~[na:1.8.0_121] at sun.net.www.http.HttpClient.(HttpClient.java:211) ~[na:1.8.0_121] at sun.net.www.http.HttpClient.New(HttpClient.java:308) ~[na:1.8.0_121] at sun.net.www.http.HttpClient.New(HttpClient.java:326) ~[na:1.8.0_121] at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1202) ~[na:1.8.0_121] at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1138) ~[na:1.8.0_121] at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:1032) ~[na:1.8.0_121] at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:966) ~[na:1.8.0_121] at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1546) ~[na:1.8.0_121] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1474) ~[na:1.8.0_121] at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480) ~[na:1.8.0_121] at feign.Client$Default.convertResponse(Client.java:152) ~[feign-core-9.4.0.jar:na] at feign.Client$Default.execute(Client.java:74) ~[feign-core-9.4.0.jar:na] at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:97) ~[feign-core-9.4.0.jar:na] at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:76) ~[feign-core-9.4.0.jar:na] at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:103) ~[feign-core-9.4.0.jar:na] at com.sun.proxy.$Proxy108.greeting(Unknown Source) ~[na:na] at com.baeldung.spring.cloud.hystrix.rest.consumer.GreetingController.getGreeting(GreetingController.java:16) ~[classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_121] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_121] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_121] at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_121] at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:205) ~[spring-web-4.3.8.RELEASE.jar:4.3.8.RELEASE]

ryanjbaxter commented 7 years ago

Please format code properly in you issues https://help.github.com/articles/creating-and-highlighting-code-blocks/

Can you please provide your pom.xml?

eacdy commented 7 years ago

hystrix for feign in dalston is disabled by default. Please add feign.hystrix.enabled = true.

spencergibb commented 7 years ago

We changed the default to off. You need to opt in with the setting mentioned above

vyao888 commented 7 years ago

Hi,

Many thanks. Now it works

Best Regards


From: 周立 notifications@github.com Sent: 02 May 2017 01:18 To: spring-cloud/spring-cloud-netflix Cc: vyao888; Author Subject: Re: [spring-cloud/spring-cloud-netflix] Circuit breaker seems not working with new spring version: BOOT: 1.5.3.RELEASE and BOM: Dalston.RELEASE (#1900)

hystrix for feign in dalston is disabled. please add feign.hystrix.enabled = true

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/spring-cloud/spring-cloud-netflix/issues/1900#issuecomment-298466269, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AFod9d59uVtAzU652h7xYmdeRylT-c4cks5r1nZUgaJpZM4NM0wR.

NagendraMekala commented 5 years ago

hi thanks working for me new version