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

Zuul Forwarding error - Internal Server error 500 #3408

Closed ghost closed 5 years ago

ghost commented 5 years ago

This is what I am trying to achieve but getting Zuul forwarding error.

  1. Zuul GitHub
  2. UserRegistration Microservice - which will call another Microservice. Also, it has some other APIs'. GitHub Link
  3. UserSearchDelete: above UserRegistration microservice will call this service. GitHub Link
  4. Eureka Server: GitHub Link

If I run the services in Springboot STS at localhost then eveything is working fine. But if I dockarise all the services and run different containers then I am getting Zuul forrwarding error.

Refer the application.yml files in the Github repos.

Could please help? Is it a bug or I am doing something wrong?

Getting the bellow error:

{
    "cause": {
        "cause": null,
        "stackTrace": [
            {
                "methodName": "getServerFromLoadBalancer",
                "fileName": "LoadBalancerContext.java",
                "lineNumber": 483,
                "className": "com.netflix.loadbalancer.LoadBalancerContext",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "LoadBalancerCommand.java",
                "lineNumber": 184,
                "className": "com.netflix.loadbalancer.reactive.LoadBalancerCommand$1",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "LoadBalancerCommand.java",
                "lineNumber": 180,
                "className": "com.netflix.loadbalancer.reactive.LoadBalancerCommand$1",
                "nativeMethod": false
            },
            {
                "methodName": "unsafeSubscribe",
                "fileName": "Observable.java",
                "lineNumber": 10327,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeConcatMap.java",
                "lineNumber": 94,
                "className": "rx.internal.operators.OnSubscribeConcatMap",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeConcatMap.java",
                "lineNumber": 42,
                "className": "rx.internal.operators.OnSubscribeConcatMap",
                "nativeMethod": false
            },
            {
                "methodName": "unsafeSubscribe",
                "fileName": "Observable.java",
                "lineNumber": 10327,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OperatorRetryWithPredicate.java",
                "lineNumber": 127,
                "className": "rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber$1",
                "nativeMethod": false
            },
            {
                "methodName": "enqueue",
                "fileName": "TrampolineScheduler.java",
                "lineNumber": 73,
                "className": "rx.internal.schedulers.TrampolineScheduler$InnerCurrentThreadScheduler",
                "nativeMethod": false
            },
            {
                "methodName": "schedule",
                "fileName": "TrampolineScheduler.java",
                "lineNumber": 52,
                "className": "rx.internal.schedulers.TrampolineScheduler$InnerCurrentThreadScheduler",
                "nativeMethod": false
            },
            {
                "methodName": "onNext",
                "fileName": "OperatorRetryWithPredicate.java",
                "lineNumber": 79,
                "className": "rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber",
                "nativeMethod": false
            },
            {
                "methodName": "onNext",
                "fileName": "OperatorRetryWithPredicate.java",
                "lineNumber": 45,
                "className": "rx.internal.operators.OperatorRetryWithPredicate$SourceSubscriber",
                "nativeMethod": false
            },
            {
                "methodName": "request",
                "fileName": "ScalarSynchronousObservable.java",
                "lineNumber": 276,
                "className": "rx.internal.util.ScalarSynchronousObservable$WeakSingleProducer",
                "nativeMethod": false
            },
            {
                "methodName": "setProducer",
                "fileName": "Subscriber.java",
                "lineNumber": 209,
                "className": "rx.Subscriber",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "ScalarSynchronousObservable.java",
                "lineNumber": 138,
                "className": "rx.internal.util.ScalarSynchronousObservable$JustOnSubscribe",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "ScalarSynchronousObservable.java",
                "lineNumber": 129,
                "className": "rx.internal.util.ScalarSynchronousObservable$JustOnSubscribe",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 48,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 48,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 48,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "subscribe",
                "fileName": "Observable.java",
                "lineNumber": 10423,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "subscribe",
                "fileName": "Observable.java",
                "lineNumber": 10390,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "blockForSingle",
                "fileName": "BlockingObservable.java",
                "lineNumber": 443,
                "className": "rx.observables.BlockingObservable",
                "nativeMethod": false
            },
            {
                "methodName": "single",
                "fileName": "BlockingObservable.java",
                "lineNumber": 340,
                "className": "rx.observables.BlockingObservable",
                "nativeMethod": false
            },
            {
                "methodName": "executeWithLoadBalancer",
                "fileName": "AbstractLoadBalancerAwareClient.java",
                "lineNumber": 112,
                "className": "com.netflix.client.AbstractLoadBalancerAwareClient",
                "nativeMethod": false
            },
            {
                "methodName": "run",
                "fileName": "AbstractRibbonCommand.java",
                "lineNumber": 186,
                "className": "org.springframework.cloud.netflix.zuul.filters.route.support.AbstractRibbonCommand",
                "nativeMethod": false
            },
            {
                "methodName": "run",
                "fileName": "AbstractRibbonCommand.java",
                "lineNumber": 51,
                "className": "org.springframework.cloud.netflix.zuul.filters.route.support.AbstractRibbonCommand",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "HystrixCommand.java",
                "lineNumber": 302,
                "className": "com.netflix.hystrix.HystrixCommand$2",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "HystrixCommand.java",
                "lineNumber": 298,
                "className": "com.netflix.hystrix.HystrixCommand$2",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDefer.java",
                "lineNumber": 46,
                "className": "rx.internal.operators.OnSubscribeDefer",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDefer.java",
                "lineNumber": 35,
                "className": "rx.internal.operators.OnSubscribeDefer",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 48,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 48,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 48,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "unsafeSubscribe",
                "fileName": "Observable.java",
                "lineNumber": 10327,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDefer.java",
                "lineNumber": 51,
                "className": "rx.internal.operators.OnSubscribeDefer",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDefer.java",
                "lineNumber": 35,
                "className": "rx.internal.operators.OnSubscribeDefer",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 48,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "unsafeSubscribe",
                "fileName": "Observable.java",
                "lineNumber": 10327,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 41,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "unsafeSubscribe",
                "fileName": "Observable.java",
                "lineNumber": 10327,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 41,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 48,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "unsafeSubscribe",
                "fileName": "Observable.java",
                "lineNumber": 10327,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 41,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "unsafeSubscribe",
                "fileName": "Observable.java",
                "lineNumber": 10327,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 41,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "unsafeSubscribe",
                "fileName": "Observable.java",
                "lineNumber": 10327,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 41,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 48,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "unsafeSubscribe",
                "fileName": "Observable.java",
                "lineNumber": 10327,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDefer.java",
                "lineNumber": 51,
                "className": "rx.internal.operators.OnSubscribeDefer",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDefer.java",
                "lineNumber": 35,
                "className": "rx.internal.operators.OnSubscribeDefer",
                "nativeMethod": false
            },
            {
                "methodName": "unsafeSubscribe",
                "fileName": "Observable.java",
                "lineNumber": 10327,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeMap.java",
                "lineNumber": 48,
                "className": "rx.internal.operators.OnSubscribeMap",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeMap.java",
                "lineNumber": 33,
                "className": "rx.internal.operators.OnSubscribeMap",
                "nativeMethod": false
            },
            {
                "methodName": "unsafeSubscribe",
                "fileName": "Observable.java",
                "lineNumber": 10327,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 41,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 48,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "unsafeSubscribe",
                "fileName": "Observable.java",
                "lineNumber": 10327,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 41,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDoOnEach.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeDoOnEach",
                "nativeMethod": false
            },
            {
                "methodName": "unsafeSubscribe",
                "fileName": "Observable.java",
                "lineNumber": 10327,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDefer.java",
                "lineNumber": 51,
                "className": "rx.internal.operators.OnSubscribeDefer",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeDefer.java",
                "lineNumber": 35,
                "className": "rx.internal.operators.OnSubscribeDefer",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 48,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "call",
                "fileName": "OnSubscribeLift.java",
                "lineNumber": 30,
                "className": "rx.internal.operators.OnSubscribeLift",
                "nativeMethod": false
            },
            {
                "methodName": "subscribe",
                "fileName": "Observable.java",
                "lineNumber": 10423,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "subscribe",
                "fileName": "Observable.java",
                "lineNumber": 10390,
                "className": "rx.Observable",
                "nativeMethod": false
            },
            {
                "methodName": "toFuture",
                "fileName": "BlockingOperatorToFuture.java",
                "lineNumber": 51,
                "className": "rx.internal.operators.BlockingOperatorToFuture",
                "nativeMethod": false
            },
            {
                "methodName": "toFuture",
                "fileName": "BlockingObservable.java",
                "lineNumber": 410,
                "className": "rx.observables.BlockingObservable",
                "nativeMethod": false
            },
            {
                "methodName": "queue",
                "fileName": "HystrixCommand.java",
                "lineNumber": 378,
                "className": "com.netflix.hystrix.HystrixCommand",
                "nativeMethod": false
            },
            {
                "methodName": "execute",
                "fileName": "HystrixCommand.java",
                "lineNumber": 344,
                "className": "com.netflix.hystrix.HystrixCommand",
                "nativeMethod": false
            },
            {
                "methodName": "forward",
                "fileName": "RibbonRoutingFilter.java",
                "lineNumber": 161,
                "className": "org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter",
                "nativeMethod": false
            },
            {
                "methodName": "run",
                "fileName": "RibbonRoutingFilter.java",
                "lineNumber": 114,
                "className": "org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter",
                "nativeMethod": false
            },
            {
                "methodName": "runFilter",
                "fileName": "ZuulFilter.java",
                "lineNumber": 117,
                "className": "com.netflix.zuul.ZuulFilter",
                "nativeMethod": false
            },
            {
                "methodName": "processZuulFilter",
                "fileName": "FilterProcessor.java",
                "lineNumber": 193,
                "className": "com.netflix.zuul.FilterProcessor",
                "nativeMethod": false
            },
            {
                "methodName": "runFilters",
                "fileName": "FilterProcessor.java",
                "lineNumber": 157,
                "className": "com.netflix.zuul.FilterProcessor",
                "nativeMethod": false
            },
            {
                "methodName": "route",
                "fileName": "FilterProcessor.java",
                "lineNumber": 118,
                "className": "com.netflix.zuul.FilterProcessor",
                "nativeMethod": false
            },
            {
                "methodName": "route",
                "fileName": "ZuulRunner.java",
                "lineNumber": 96,
                "className": "com.netflix.zuul.ZuulRunner",
                "nativeMethod": false
            },
            {
                "methodName": "route",
                "fileName": "ZuulServlet.java",
                "lineNumber": 116,
                "className": "com.netflix.zuul.http.ZuulServlet",
                "nativeMethod": false
            },
            {
                "methodName": "service",
                "fileName": "ZuulServlet.java",
                "lineNumber": 81,
                "className": "com.netflix.zuul.http.ZuulServlet",
                "nativeMethod": false
            },
            {
                "methodName": "handleRequestInternal",
                "fileName": "ServletWrappingController.java",
                "lineNumber": 165,
                "className": "org.springframework.web.servlet.mvc.ServletWrappingController",
                "nativeMethod": false
            },
            {
                "methodName": "handleRequest",
                "fileName": "ZuulController.java",
                "lineNumber": 44,
                "className": "org.springframework.cloud.netflix.zuul.web.ZuulController",
                "nativeMethod": false
            },
            {
                "methodName": "handle",
                "fileName": "SimpleControllerHandlerAdapter.java",
                "lineNumber": 52,
                "className": "org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter",
                "nativeMethod": false
            },
            {
                "methodName": "doDispatch",
                "fileName": "DispatcherServlet.java",
                "lineNumber": 1038,
                "className": "org.springframework.web.servlet.DispatcherServlet",
                "nativeMethod": false
            },
            {
                "methodName": "doService",
                "fileName": "DispatcherServlet.java",
                "lineNumber": 942,
                "className": "org.springframework.web.servlet.DispatcherServlet",
                "nativeMethod": false
            },
            {
                "methodName": "processRequest",
                "fileName": "FrameworkServlet.java",
                "lineNumber": 1005,
                "className": "org.springframework.web.servlet.FrameworkServlet",
                "nativeMethod": false
            },
            {
                "methodName": "doGet",
                "fileName": "FrameworkServlet.java",
                "lineNumber": 897,
                "className": "org.springframework.web.servlet.FrameworkServlet",
                "nativeMethod": false
            },
            {
                "methodName": "service",
                "fileName": "HttpServlet.java",
                "lineNumber": 634,
                "className": "javax.servlet.http.HttpServlet",
                "nativeMethod": false
            },
            {
                "methodName": "service",
                "fileName": "FrameworkServlet.java",
                "lineNumber": 882,
                "className": "org.springframework.web.servlet.FrameworkServlet",
                "nativeMethod": false
            },
            {
                "methodName": "service",
                "fileName": "HttpServlet.java",
                "lineNumber": 741,
                "className": "javax.servlet.http.HttpServlet",
                "nativeMethod": false
            },
            {
                "methodName": "internalDoFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 231,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 166,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "WsFilter.java",
                "lineNumber": 53,
                "className": "org.apache.tomcat.websocket.server.WsFilter",
                "nativeMethod": false
            },
            {
                "methodName": "internalDoFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 193,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 166,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilterInternal",
                "fileName": "HttpTraceFilter.java",
                "lineNumber": 90,
                "className": "org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "OncePerRequestFilter.java",
                "lineNumber": 107,
                "className": "org.springframework.web.filter.OncePerRequestFilter",
                "nativeMethod": false
            },
            {
                "methodName": "internalDoFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 193,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 166,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilterInternal",
                "fileName": "RequestContextFilter.java",
                "lineNumber": 99,
                "className": "org.springframework.web.filter.RequestContextFilter",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "OncePerRequestFilter.java",
                "lineNumber": 107,
                "className": "org.springframework.web.filter.OncePerRequestFilter",
                "nativeMethod": false
            },
            {
                "methodName": "internalDoFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 193,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 166,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilterInternal",
                "fileName": "FormContentFilter.java",
                "lineNumber": 92,
                "className": "org.springframework.web.filter.FormContentFilter",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "OncePerRequestFilter.java",
                "lineNumber": 107,
                "className": "org.springframework.web.filter.OncePerRequestFilter",
                "nativeMethod": false
            },
            {
                "methodName": "internalDoFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 193,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 166,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilterInternal",
                "fileName": "HiddenHttpMethodFilter.java",
                "lineNumber": 93,
                "className": "org.springframework.web.filter.HiddenHttpMethodFilter",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "OncePerRequestFilter.java",
                "lineNumber": 107,
                "className": "org.springframework.web.filter.OncePerRequestFilter",
                "nativeMethod": false
            },
            {
                "methodName": "internalDoFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 193,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 166,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "filterAndRecordMetrics",
                "fileName": "WebMvcMetricsFilter.java",
                "lineNumber": 117,
                "className": "org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter",
                "nativeMethod": false
            },
            {
                "methodName": "doFilterInternal",
                "fileName": "WebMvcMetricsFilter.java",
                "lineNumber": 106,
                "className": "org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "OncePerRequestFilter.java",
                "lineNumber": 107,
                "className": "org.springframework.web.filter.OncePerRequestFilter",
                "nativeMethod": false
            },
            {
                "methodName": "internalDoFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 193,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 166,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilterInternal",
                "fileName": "CharacterEncodingFilter.java",
                "lineNumber": 200,
                "className": "org.springframework.web.filter.CharacterEncodingFilter",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "OncePerRequestFilter.java",
                "lineNumber": 107,
                "className": "org.springframework.web.filter.OncePerRequestFilter",
                "nativeMethod": false
            },
            {
                "methodName": "internalDoFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 193,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "doFilter",
                "fileName": "ApplicationFilterChain.java",
                "lineNumber": 166,
                "className": "org.apache.catalina.core.ApplicationFilterChain",
                "nativeMethod": false
            },
            {
                "methodName": "invoke",
                "fileName": "StandardWrapperValve.java",
                "lineNumber": 200,
                "className": "org.apache.catalina.core.StandardWrapperValve",
                "nativeMethod": false
            },
            {
                "methodName": "invoke",
                "fileName": "StandardContextValve.java",
                "lineNumber": 96,
                "className": "org.apache.catalina.core.StandardContextValve",
                "nativeMethod": false
            },
            {
                "methodName": "invoke",
                "fileName": "AuthenticatorBase.java",
                "lineNumber": 490,
                "className": "org.apache.catalina.authenticator.AuthenticatorBase",
                "nativeMethod": false
            },
            {
                "methodName": "invoke",
                "fileName": "StandardHostValve.java",
                "lineNumber": 139,
                "className": "org.apache.catalina.core.StandardHostValve",
                "nativeMethod": false
            },
            {
                "methodName": "invoke",
                "fileName": "ErrorReportValve.java",
                "lineNumber": 92,
                "className": "org.apache.catalina.valves.ErrorReportValve",
                "nativeMethod": false
            },
            {
                "methodName": "invoke",
                "fileName": "StandardEngineValve.java",
                "lineNumber": 74,
                "className": "org.apache.catalina.core.StandardEngineValve",
                "nativeMethod": false
            },
            {
                "methodName": "service",
                "fileName": "CoyoteAdapter.java",
                "lineNumber": 343,
                "className": "org.apache.catalina.connector.CoyoteAdapter",
                "nativeMethod": false
            },
            {
                "methodName": "service",
                "fileName": "Http11Processor.java",
                "lineNumber": 408,
                "className": "org.apache.coyote.http11.Http11Processor",
                "nativeMethod": false
            },
            {
                "methodName": "process",
                "fileName": "AbstractProcessorLight.java",
                "lineNumber": 66,
                "className": "org.apache.coyote.AbstractProcessorLight",
                "nativeMethod": false
            },
            {
                "methodName": "process",
                "fileName": "AbstractProtocol.java",
                "lineNumber": 834,
                "className": "org.apache.coyote.AbstractProtocol$ConnectionHandler",
                "nativeMethod": false
            },
            {
                "methodName": "doRun",
                "fileName": "NioEndpoint.java",
                "lineNumber": 1415,
                "className": "org.apache.tomcat.util.net.NioEndpoint$SocketProcessor",
                "nativeMethod": false
            },
            {
                "methodName": "run",
                "fileName": "SocketProcessorBase.java",
                "lineNumber": 49,
                "className": "org.apache.tomcat.util.net.SocketProcessorBase",
                "nativeMethod": false
            },
            {
                "methodName": "runWorker",
                "fileName": "ThreadPoolExecutor.java",
                "lineNumber": 1142,
                "className": "java.util.concurrent.ThreadPoolExecutor",
                "nativeMethod": false
            },
            {
                "methodName": "run",
                "fileName": "ThreadPoolExecutor.java",
                "lineNumber": 617,
                "className": "java.util.concurrent.ThreadPoolExecutor$Worker",
                "nativeMethod": false
            },
            {
                "methodName": "run",
                "fileName": "TaskThread.java",
                "lineNumber": 61,
                "className": "org.apache.tomcat.util.threads.TaskThread$WrappingRunnable",
                "nativeMethod": false
            },
            {
                "methodName": "run",
                "fileName": "Thread.java",
                "lineNumber": 745,
                "className": "java.lang.Thread",
                "nativeMethod": false
            }
        ],
        "errorCode": 0,
        "message": "Load balancer does not have available server for client: user-registation-service",
        "errorObject": null,
        "errorType": "GENERAL",
        "errorMessage": "Load balancer does not have available server for client: user-registation-service",
        "internalMessage": "{no message: 0}",
        "localizedMessage": "Load balancer does not have available server for client: user-registation-service",
        "suppressed": []
    },
    "stackTrace": [
        {
            "methodName": "handleException",
            "fileName": "RibbonRoutingFilter.java",
            "lineNumber": 191,
            "className": "org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter",
            "nativeMethod": false
        },
        {
            "methodName": "forward",
            "fileName": "RibbonRoutingFilter.java",
            "lineNumber": 166,
            "className": "org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter",
            "nativeMethod": false
        },
        {
            "methodName": "run",
            "fileName": "RibbonRoutingFilter.java",
            "lineNumber": 114,
            "className": "org.springframework.cloud.netflix.zuul.filters.route.RibbonRoutingFilter",
            "nativeMethod": false
        },
        {
            "methodName": "runFilter",
            "fileName": "ZuulFilter.java",
            "lineNumber": 117,
            "className": "com.netflix.zuul.ZuulFilter",
            "nativeMethod": false
        },
        {
            "methodName": "processZuulFilter",
            "fileName": "FilterProcessor.java",
            "lineNumber": 193,
            "className": "com.netflix.zuul.FilterProcessor",
            "nativeMethod": false
        },
        {
            "methodName": "runFilters",
            "fileName": "FilterProcessor.java",
            "lineNumber": 157,
            "className": "com.netflix.zuul.FilterProcessor",
            "nativeMethod": false
        },
        {
            "methodName": "route",
            "fileName": "FilterProcessor.java",
            "lineNumber": 118,
            "className": "com.netflix.zuul.FilterProcessor",
            "nativeMethod": false
        },
        {
            "methodName": "route",
            "fileName": "ZuulRunner.java",
            "lineNumber": 96,
            "className": "com.netflix.zuul.ZuulRunner",
            "nativeMethod": false
        },
        {
            "methodName": "route",
            "fileName": "ZuulServlet.java",
            "lineNumber": 116,
            "className": "com.netflix.zuul.http.ZuulServlet",
            "nativeMethod": false
        },
        {
            "methodName": "service",
            "fileName": "ZuulServlet.java",
            "lineNumber": 81,
            "className": "com.netflix.zuul.http.ZuulServlet",
            "nativeMethod": false
        },
        {
            "methodName": "handleRequestInternal",
            "fileName": "ServletWrappingController.java",
            "lineNumber": 165,
            "className": "org.springframework.web.servlet.mvc.ServletWrappingController",
            "nativeMethod": false
        },
        {
            "methodName": "handleRequest",
            "fileName": "ZuulController.java",
            "lineNumber": 44,
            "className": "org.springframework.cloud.netflix.zuul.web.ZuulController",
            "nativeMethod": false
        },
        {
            "methodName": "handle",
            "fileName": "SimpleControllerHandlerAdapter.java",
            "lineNumber": 52,
            "className": "org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter",
            "nativeMethod": false
        },
        {
            "methodName": "doDispatch",
            "fileName": "DispatcherServlet.java",
            "lineNumber": 1038,
            "className": "org.springframework.web.servlet.DispatcherServlet",
            "nativeMethod": false
        },
        {
            "methodName": "doService",
            "fileName": "DispatcherServlet.java",
            "lineNumber": 942,
            "className": "org.springframework.web.servlet.DispatcherServlet",
            "nativeMethod": false
        },
        {
            "methodName": "processRequest",
            "fileName": "FrameworkServlet.java",
            "lineNumber": 1005,
            "className": "org.springframework.web.servlet.FrameworkServlet",
            "nativeMethod": false
        },
        {
            "methodName": "doGet",
            "fileName": "FrameworkServlet.java",
            "lineNumber": 897,
            "className": "org.springframework.web.servlet.FrameworkServlet",
            "nativeMethod": false
        },
        {
            "methodName": "service",
            "fileName": "HttpServlet.java",
            "lineNumber": 634,
            "className": "javax.servlet.http.HttpServlet",
            "nativeMethod": false
        },
        {
            "methodName": "service",
            "fileName": "FrameworkServlet.java",
            "lineNumber": 882,
            "className": "org.springframework.web.servlet.FrameworkServlet",
            "nativeMethod": false
        },
        {
            "methodName": "service",
            "fileName": "HttpServlet.java",
            "lineNumber": 741,
            "className": "javax.servlet.http.HttpServlet",
            "nativeMethod": false
        },
        {
            "methodName": "internalDoFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 231,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 166,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "WsFilter.java",
            "lineNumber": 53,
            "className": "org.apache.tomcat.websocket.server.WsFilter",
            "nativeMethod": false
        },
        {
            "methodName": "internalDoFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 193,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 166,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilterInternal",
            "fileName": "HttpTraceFilter.java",
            "lineNumber": 90,
            "className": "org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "OncePerRequestFilter.java",
            "lineNumber": 107,
            "className": "org.springframework.web.filter.OncePerRequestFilter",
            "nativeMethod": false
        },
        {
            "methodName": "internalDoFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 193,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 166,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilterInternal",
            "fileName": "RequestContextFilter.java",
            "lineNumber": 99,
            "className": "org.springframework.web.filter.RequestContextFilter",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "OncePerRequestFilter.java",
            "lineNumber": 107,
            "className": "org.springframework.web.filter.OncePerRequestFilter",
            "nativeMethod": false
        },
        {
            "methodName": "internalDoFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 193,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 166,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilterInternal",
            "fileName": "FormContentFilter.java",
            "lineNumber": 92,
            "className": "org.springframework.web.filter.FormContentFilter",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "OncePerRequestFilter.java",
            "lineNumber": 107,
            "className": "org.springframework.web.filter.OncePerRequestFilter",
            "nativeMethod": false
        },
        {
            "methodName": "internalDoFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 193,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 166,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilterInternal",
            "fileName": "HiddenHttpMethodFilter.java",
            "lineNumber": 93,
            "className": "org.springframework.web.filter.HiddenHttpMethodFilter",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "OncePerRequestFilter.java",
            "lineNumber": 107,
            "className": "org.springframework.web.filter.OncePerRequestFilter",
            "nativeMethod": false
        },
        {
            "methodName": "internalDoFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 193,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 166,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "filterAndRecordMetrics",
            "fileName": "WebMvcMetricsFilter.java",
            "lineNumber": 117,
            "className": "org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter",
            "nativeMethod": false
        },
        {
            "methodName": "doFilterInternal",
            "fileName": "WebMvcMetricsFilter.java",
            "lineNumber": 106,
            "className": "org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "OncePerRequestFilter.java",
            "lineNumber": 107,
            "className": "org.springframework.web.filter.OncePerRequestFilter",
            "nativeMethod": false
        },
        {
            "methodName": "internalDoFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 193,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 166,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilterInternal",
            "fileName": "CharacterEncodingFilter.java",
            "lineNumber": 200,
            "className": "org.springframework.web.filter.CharacterEncodingFilter",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "OncePerRequestFilter.java",
            "lineNumber": 107,
            "className": "org.springframework.web.filter.OncePerRequestFilter",
            "nativeMethod": false
        },
        {
            "methodName": "internalDoFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 193,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "doFilter",
            "fileName": "ApplicationFilterChain.java",
            "lineNumber": 166,
            "className": "org.apache.catalina.core.ApplicationFilterChain",
            "nativeMethod": false
        },
        {
            "methodName": "invoke",
            "fileName": "StandardWrapperValve.java",
            "lineNumber": 200,
            "className": "org.apache.catalina.core.StandardWrapperValve",
            "nativeMethod": false
        },
        {
            "methodName": "invoke",
            "fileName": "StandardContextValve.java",
            "lineNumber": 96,
            "className": "org.apache.catalina.core.StandardContextValve",
            "nativeMethod": false
        },
        {
            "methodName": "invoke",
            "fileName": "AuthenticatorBase.java",
            "lineNumber": 490,
            "className": "org.apache.catalina.authenticator.AuthenticatorBase",
            "nativeMethod": false
        },
        {
            "methodName": "invoke",
            "fileName": "StandardHostValve.java",
            "lineNumber": 139,
            "className": "org.apache.catalina.core.StandardHostValve",
            "nativeMethod": false
        },
        {
            "methodName": "invoke",
            "fileName": "ErrorReportValve.java",
            "lineNumber": 92,
            "className": "org.apache.catalina.valves.ErrorReportValve",
            "nativeMethod": false
        },
        {
            "methodName": "invoke",
            "fileName": "StandardEngineValve.java",
            "lineNumber": 74,
            "className": "org.apache.catalina.core.StandardEngineValve",
            "nativeMethod": false
        },
        {
            "methodName": "service",
            "fileName": "CoyoteAdapter.java",
            "lineNumber": 343,
            "className": "org.apache.catalina.connector.CoyoteAdapter",
            "nativeMethod": false
        },
        {
            "methodName": "service",
            "fileName": "Http11Processor.java",
            "lineNumber": 408,
            "className": "org.apache.coyote.http11.Http11Processor",
            "nativeMethod": false
        },
        {
            "methodName": "process",
            "fileName": "AbstractProcessorLight.java",
            "lineNumber": 66,
            "className": "org.apache.coyote.AbstractProcessorLight",
            "nativeMethod": false
        },
        {
            "methodName": "process",
            "fileName": "AbstractProtocol.java",
            "lineNumber": 834,
            "className": "org.apache.coyote.AbstractProtocol$ConnectionHandler",
            "nativeMethod": false
        },
        {
            "methodName": "doRun",
            "fileName": "NioEndpoint.java",
            "lineNumber": 1415,
            "className": "org.apache.tomcat.util.net.NioEndpoint$SocketProcessor",
            "nativeMethod": false
        },
        {
            "methodName": "run",
            "fileName": "SocketProcessorBase.java",
            "lineNumber": 49,
            "className": "org.apache.tomcat.util.net.SocketProcessorBase",
            "nativeMethod": false
        },
        {
            "methodName": "runWorker",
            "fileName": "ThreadPoolExecutor.java",
            "lineNumber": 1142,
            "className": "java.util.concurrent.ThreadPoolExecutor",
            "nativeMethod": false
        },
        {
            "methodName": "run",
            "fileName": "ThreadPoolExecutor.java",
            "lineNumber": 617,
            "className": "java.util.concurrent.ThreadPoolExecutor$Worker",
            "nativeMethod": false
        },
        {
            "methodName": "run",
            "fileName": "TaskThread.java",
            "lineNumber": 61,
            "className": "org.apache.tomcat.util.threads.TaskThread$WrappingRunnable",
            "nativeMethod": false
        },
        {
            "methodName": "run",
            "fileName": "Thread.java",
            "lineNumber": 745,
            "className": "java.lang.Thread",
            "nativeMethod": false
        }
    ],
    "nStatusCode": 500,
    "errorCause": "GENERAL",
    "message": "Forwarding error",
    "localizedMessage": "Forwarding error",
    "suppressed": []
}
ryanjbaxter commented 5 years ago

Seems like the client does not know about this service Load balancer does not have available server for client: user-registation-service.

ghost commented 5 years ago

This is how services are getting called: zuul --> user-registration-service --> user-search-delete-service All the three servicess are getting resgistred in Eureka client.

I have defined "user-search-delete-service" as a Ribbon client of "user-registration-service". Also used RestTemplate to call "user-search-delete-service" methods from "user-registration-service"

@EnableEurekaClient
@SpringBootApplication
@RibbonClient(name = "user-search-delete-service", configuration = UserSearchDeleteRibbonConfiguration.class)
public class UserRegistrationMicroSrvApplication {

    public static void main(String[] args) {
        SpringApplication.run(UserRegistrationMicroSrvApplication.class, args);
    }
}
@Configuration
class RestTemplateConfig {

    // Create a bean for restTemplate to call services
    @Bean
    @LoadBalanced       // Load balance between service instances running at different ports.
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}

Do I need to define "user-registration-service" as a Riboon client in zuul service? If yes then can you please let me know why?

Currently Zuul application looks like below:

@SpringBootApplication
@EnableEurekaClient     // It acts as a eureka client
@EnableZuulProxy        // Enable Zuul
public class ZuulServerApiGatewayApplication {

    public static void main(String[] args) {
        SpringApplication.run(ZuulServerApiGatewayApplication.class, args);
    }

}

Could you please help me to understand what I need to change so that Load balancer can find client: user-registation-service?

ghost commented 5 years ago

I have changed the yml files of all the tree services and mention client:fetch-registry: true also but still it did not work. Can you please help me? Not sure where is the issue.


eureka:
  instance:
    prefer-ip-address: true
    leaseRenewalIntervalInSeconds: 1
    leaseExpirationDurationInSeconds: 2
    metadata-map:
      zone: zone1
    instance-id: ${spring.application.name}
  client:
    prefer-same-zone-eureka: true
    register-with-eureka: true
    fetch-registry: true
    region: region1
    service-url:
      zone1: http://eureka-server:8761/eureka/
    availability-zones:
      region1: zone1
    healthcheck:
      enabled: true
spencergibb commented 5 years ago

Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

ghost commented 5 years ago

Eureka Server:

@SpringBootApplication
@EnableEurekaServer
public class UserRegistrationEurekaServerApplication {
    public static void main(String[] args) {
        SpringApplication.run(UserRegistrationEurekaServerApplication.class, args);
    }
}

Eureka Application properties:

spring:
  application:
    name: eureka-server

server:
  port: 8761
eureka:
  client:
    register-with-eureka: false
    fetch-registry: false
    region: region1
    serviceUrl:
      zone1: http://eureka-server:8761/eureka/
    availability-zones:
      region1: zone1
  instance:
    hostname: eureka-server
    metadata-map:
      zone: zone1

Zuul:

@SpringBootApplication
@EnableEurekaClient     // It acts as a eureka client
@EnableZuulProxy        // Enable Zuul
public class ZuulServerApiGatewayApplication {

    public static void main(String[] args) {
        SpringApplication.run(ZuulServerApiGatewayApplication.class, args);
    }

}

Zuul Application properties:

spring:
  application:
    name: zuul-server
server:
  port: 8762

zuul:
  ignored-services: '*'
  routes:
   user-registration-service: 
     path: /api/**
     service-id: user-registation-service

user-registation-service:
  ribbon:
    eureka:
      enabled: true
    ServerListRefreshInterval: 1000
    ReadTimeout: 60000
    ConnectTimeout: 60000

user-search-delete-service:
  ribbon:
    eureka:
      enabled: true
    ServerListRefreshInterval: 1000
    ReadTimeout: 60000
    ConnectTimeout: 60000

hystrix:
  command:
    user-registation-service:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 60000
    user-search-delete-service:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 60000
    default:
      execution:
        isolation:
          strategy: THREAD
          thread:
            timeoutInMilliseconds: 600000

eureka:
  instance:
    prefer-ip-address: true
    leaseRenewalIntervalInSeconds: 1
    leaseExpirationDurationInSeconds: 2
    fetch-registry: true
    metadata-map:
      zone: zone1
    instance-id: ${spring.application.name}:${random.value}
  client:
    prefer-same-zone-eureka: true
    register-with-eureka: true
    fetch-registry: true
    region: region1
    service-url:
      zone1: http://eureka-server:8761/eureka/
    availability-zones:
      region1: zone1
    healthcheck:
      enabled: true     

User Registration Service:

@EnableEurekaClient
@SpringBootApplication
@RibbonClient(name = "user-search-delete-service", configuration = UserSearchDeleteRibbonConfiguration.class)
public class UserRegistrationMicroSrvApplication {
    public static void main(String[] args) {
        SpringApplication.run(UserRegistrationMicroSrvApplication.class, args);
    }
}

@Configuration
class RestTemplateConfig {

    // Create a bean for restTemplate to call services
    @Bean
    @LoadBalanced       // Load balance between service instances running at different ports.
    public RestTemplate restTemplate() {
        return new RestTemplate();
    }
}

User Registration application properties:

spring:
  datasource:
    driver-class-name: com.mysql.cj.jdbc.Driver
    url: jdbc:mysql://db-server:3306/WEBUSERDB?autoreconnect = true
    username: root
    password: mandal01
  application:
    name: user-registation-service
server:
  port: 8081
user-search-delete-service:
  ribbon:
    eureka:
      enabled: true
    ServerListRefreshInterval: 1000
    ReadTimeout: 60000
    ConnectTimeout: 60000
eureka:
  instance:
    prefer-ip-address: true
    leaseRenewalIntervalInSeconds: 1
    leaseExpirationDurationInSeconds: 2
    fetch-registry: true
    metadata-map:
      zone: zone1
    instance-id: ${spring.application.name}:${random.value}
  client:
    prefer-same-zone-eureka: true
    register-with-eureka: true
    region: region1
    service-url:
      zone1: http://eureka-server:8761/eureka/
    availability-zones:
      region1: zone1
    healthcheck:
      enabled: true  
hystrix:
  command:
    user-registation-service:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 60000
    user-search-delete-service:
      execution:
        isolation:
          thread:
            timeoutInMilliseconds: 60000
    default:
      execution:
        isolation:
          strategy: THREAD
          thread:
            timeoutInMilliseconds: 60000

Calling "User Search Delete" service from "User Registration Service":

Part of controller service:

@RequestMapping(value = "/CreateUser", headers="Content-Type=application/json", method = RequestMethod.POST)
       public ResponseEntity<Object> createUser(@RequestBody UserRecord userRecBody ) { 

boolean UserIdExists = restTemplate.getForObject("http://user-search-delete-service/SearchUser/"+UserId, boolean.class );

Also there is a "User Search Delete" service. All the services are sperate Spring Boot application and I have dockarisd to run in a seperate containers on bridge network. All the three services are getting registred in Eureka server.

My expectation is, when I am calling "CreateUser" API, Zuul will be able to find "User Registration service". But looks like Zuul is not able to find the service and throwing a "Forwarding error".

Best part is when I am running all the application from the SPring Boot app then its working fine. But when I am running on Containers then getting the issue.

I am now clueless where is the issue.

spencergibb commented 5 years ago

It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

pasted code isn't helpful.

ghost commented 5 years ago

@spencergibb Please find below the Git Repo Link for the CMV sample. https://github.com/git4suvendu/UserRegistrationApp

spencergibb commented 5 years ago

My guess is that it has to do with the short intervals for lease renewal and server last refresh. Try extending those and see if that helps.

ghost commented 5 years ago

Changing it to the below values and running. Will give you feedback.

leaseRenewalIntervalInSeconds: 30 leaseExpirationDurationInSeconds: 40

ghost commented 5 years ago

@spencergibb I have changed the lease renewal and expiration intervals. but still getting the issue. Updated Git with changed yml files

ghost commented 5 years ago

@spencergibb Changed ServerListRefreshInterval: 2 but still the same issue. Pls help.

ghost commented 5 years ago

Tried with ServerListRefreshInterval: 60000 but no luck !!

ghost commented 5 years ago

@spencergibb Can you please help to resolve the issue?

ghost commented 5 years ago

Found the issue. There was a typo in the application name in the user registration service yml file.