feign.RetryableException:读取超时,执行GET http:// forex-service / currency-exchange / from / EUR / to / INR \ r \ n \ tat feign.FeignException.errorExecu

时间:2019-01-21 16:51:03

标签: spring netflix-feign spring-cloud-feign

我正在跟踪来自http://www.springboottutorial.com/microservices-with-spring-boot-part-5-eureka-naming-server的微服务代码,并使用Spring Boot和Spring Cloud的最新版本,到目前为止是2.1.2.RELEASEGreenwich.RC2

当我点击

  

卷曲-XGET http://localhost:8100/currency-converter-feign/from/EUR/to/INR/quantity/10000

我遇到了错误。

  

{“时间戳”:“ 2019-01-21T16:48:19.250 + 0000”,“状态”:500,“错误”:“内部服务器错误”,“消息”:“读取超时,执行GET {{ 3}}“,” trace“:” feign.RetryableException:读取超时,执行GET http://forex-service/currency-exchange/from/EUR/to/INR \ r \ n \ tat feign.FeignException.errorExecuting(FeignException.java:84)\ r \ n \ tat feign。 SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:113)\ r \ n \ t feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:78)\ r \ n \ tat feign.ReflectiveFeign $ FeignInvocationHandler.invoke(ReflectiveFeign.java:103)\ r \ n \ tat com.sun.proxy。$ Proxy84.retrieveExchangeValue(未知来源)\ r \ n \ tat com.prateek.currencyconversion.CurrencyConversionController.convertCurrencyFeign(CurrencyConversionController.java:47)\ r \ n \ tat sun.reflect。 NativeMethodAccessorImpl.invoke0(本机方法)\ r \ n \ tat sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)\ r \ n \ tat sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)\ r \ n n \ tat java.lang.refl ect.Method.invoke(Method.java:498)\ r \ n \ tat org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:189)\ r \ n \ tat org.springframework.web。 method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)\ r \ n \ tat org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102)\ r \ n \ tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895)\ r \ n \ tat org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter。 java:800)\ r \ n \ tat org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)\ r \ n \ tat org.springframework.web.servlet.DispatcherServlet.doDispatch( DispatcherServlet.java:1038)\r\n\tat org.springframework.web.servlet.DispatcherServlet.doService (DispatcherServlet.java:942)\r\n\t org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)\ r \ n \ tat org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet .java:897)\ r \ n \ tat javax.servlet.http.HttpServlet.service(HttpServlet.java:634)\ r \ n \ tat org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882 )\ r \ n \ tat javax.servlet.http.HttpServlet.service(HttpServlet.java:741)\ r \ n \ tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)\ r \ n \ tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\ r \ n \ tat org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)\ r \ n \ tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\ r \ n \ tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\ r \ n \ tat org.springframework.web.filter.RequestContextFilter.doFi lterInternal(RequestContextFilter.java:99)\ r \ n \ tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\ r \ n \ tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\ r \ n \ tat org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter。 java:92)\ r \ n \ tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\ r \ n \ tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java: 193)\ r \ n \ tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\ r \ n \ tat org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) \ r \ n \ tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\ r \ n \ tat org.apache.catalina.core.Appl icationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)\ r \ n \ tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\ r \ n \ tat org.springframework.web.filter.CharacterEncodingFilter。 doFilterInternal(CharacterEncodingFilter.java:200)\ r \ n \ tat org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)\ r \ n \ tat org.apache.catalina.core.ApplicationFilterChain.internalDoFilter( ApplicationFilterChain.java:193)\r\n\tat org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)\ r \ n \ tat org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve。 java:199)\ r \ n \ tat org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)\ r \ n \ tat org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java: 490)\ r \ n \ tat org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)\ r \ n \ tat org.apache.catalina.valves.ErrorReportValve .invoke(ErrorReportValve.java:92)\ r \ n \ tat org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)\ r \ n \ tat org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:343)\r\n\tat org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)\ r \ n \ tat org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java :66)\ r \ n \ tat org.apache.coyote.AbstractProtocol $ ConnectionHandler.process(AbstractProtocol.java:834)\ r \ n \ tat org.apache.tomcat.util.net.NioEndpoint $ SocketProcessor.doRun(NioEndpoint .java:1417)\ r \ n \ tat org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)\ r \ n \ tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java :1149)\ r \ n \ tat java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)\ r \ n \ tat org.apache.tomcat.util.threads.TaskThread $ WrappingRunnable.run(TaskThread .java:61)\ r \ n \ tat java.lang.Thread.run(Thread.java:748)\ r \ n原因:java.net.SocketTim eoutException:读取超时\ r \ n \ tat java.net.SocketInputStream.socketRead0(本机方法)\ r \ n \ tat java.net.SocketInputStream.socketRead(SocketInputStream.java:116)\ r \ n \ tat java。 net.SocketInputStream.read(SocketInputStream.java:171)\ r \ n \ tat java.net.SocketInputStream.read(SocketInputStream.java:141)\ r \ n \ tat java.io.BufferedInputStream.fill(BufferedInputStream.java: 246)\ r \ n \ tat java.io.BufferedInputStream.read1(BufferedInputStream.java:286)\ r \ n \ tat java.io.BufferedInputStream.read(BufferedInputStream.java:345)\ r \ n \ tat sun。 net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:735)\ r \ n \ t sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:678)\ r \ n \ tat sun.net www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1587)\ r \ n \ tat sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1492)\ r \ n \ tat java。 net.HttpURLConnection.getResponseCode(HttpURLConnection.java:480)\ r \ n \ t feign.Client $ Default.convertResponse(Client.java:143)\ r \ n \ tat fe ign.Client $ Default.execute(Client.java:68)\ r \ n \ tat org.springframework.cloud.openfeign.ribbon.FeignLoadBalancer.execute(FeignLoadBalancer.java:90)\ r \ n \ tat org.springframework。 cloud.openfeign.ribbon.FeignLoadBalancer.execute(FeignLoadBalancer.java:56)\ r \ n \ tat com.netflix.client.AbstractLoadBalancerAwareClient $ 1.call(AbstractLoadBalancerAwareClient.java:104)\ r \ n \ tat com.netflix.loadbalancer .reactive.LoadBalancerCommand $ 3 $ 1.call(LoadBalancerCommand.java:303)\ r \ n \ tat com.netflix.loadbalancer.reactive.LoadBalancerCommand $ 3 $ 1.call(LoadBalancerCommand.java:287)\ r \ n \ tat rx.internal .util.ScalarSynchronousObservable $ 3.call(ScalarSynchronousObservable.java:231)\ r \ n \ tat rx.internal.util.ScalarSynchronousObservable $ 3.call(ScalarSynchronousObservable.java:228)\ r \ n \ tat rx.Observable。 .java:10327)\ r \ n \ tat rx.internal.operators.OnSubscribeConcatMap $ ConcatMapSubscriber.drain(OnSubscribeConcatMap.java:286)\ r \ n \ tat rx.internal.operators.OnSubscribeConcatMap $ ConcatMapSubscriber.onN ext(OnSubscribeCo100 10754 0 10754 0 0 2397 0-:-:-0:00:04-:-:-25201.call(LoadBalancerCommand.java:185)\ r \ n \ tat com.netflix .loadbalancer.reactive.LoadBalancerCommand $ 1.call(LoadBalancerCommand.java:180)\ r \ n \ tat rx.Observable.unsafeSubscribe(Observable.java:10327)\ r \ n \ tat rx.internal.operators.OnSubscribeConcatMap.call( OnSubscribeConcatMap.java:94)\r\n\tat rx.internal.operators.OnSubscribeConcatMap.call(OnSubscribeConcatMap.java:42)\ r \ n \ tat rx.Observable.unsafeSubscribe(Observable.java:10327)\ r \ n \ tat rx.internal.operators.OperatorRetryWithPredicate $ SourceSubscriber $ 1.call(OperatorRetryWithPredicate.java:127)\ r \ n \ tat rx.internal.schedulers.TrampolineScheduler $ InnerCurrentThreadScheduler.enqueue(TrampolineScheduler \ java:73)\ r tat rx.internal.schedulers.TrampolineScheduler $ InnerCurrentThreadScheduler.schedule(TrampolineScheduler.java:52)\ r \ n \ tat rx.internal.operators.OperatorRetryWithPredicate $ SourceSubscriber.onNext(OperatorRetryWithPredicate.java:79)\ r \ n rx.internal.operators.OperatorRetryWithPredicate $ SourceSubscriber.onNext(OperatorRetryWithPredicate.java:45)\ r \ n \ tat rx.internal.util.ScalarSynchronousObservable $ WeakSingleProducer.request(ScalarSynchronousObservable.java:276) Subscriber.setProducer(Subscriber.java:209)\ r \ n \ tat rx.internal.util.ScalarSynchronousObservable $ JustOnSubscribe.call(ScalarSynchronousObservable.java:138)\ r \ n \ tat rx.internal.util.ScalarSynchronousObservable $ Just调用(ScalarSynchronousObservable.java:129)\r\n\tat rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)\ r \ n \ tat rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java: 30)\ r \ n \ tat rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)\ r \ n \ tat rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)\ r \ n \ tat rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:48)\ r \ n \ tat rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)\ r \ n \ tat rx.Observable。订阅(Obser vable.java:10423)\r\n\tat rx.Observable.subscribe(Observable.java:10390)\ r \ n \ tat rx.observables.BlockingObservable.blockForSingle(BlockingObservable.java:443)\ r \ n \ tat rx.observables.BlockingObservable.single(BlockingObservable.java:340)\ r \ n \ tat com.netflix.client.AbstractLoadBalancerAwareClient.executeWithLoadBalancer(AbstractLoadBalancerAwareClient.java:112)\ r \ n \ tat org.springframework.cloud.openfeign ribbon.LoadBalancerFeignClient.execute(LoadBalancerFeignClient.java:65)\ r \ n \ t feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:108)\ r \ n \ t ... 58 more \ r \ n“,” path“ :“ / currency-converter-feign / from / EUR / to / INR / quantity / 10000”}

http://forex-service/currency-exchange/from/EUR/to/INR

1 个答案:

答案 0 :(得分:0)

我不确定通过添加以下更改现在如何正常工作。

<repositories>
    <repository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>

<pluginRepositories>
    <pluginRepository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>https://repo.spring.io/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </pluginRepository>
    <pluginRepository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>https://repo.spring.io/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>

enter image description here

enter image description here