spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

Load-balanced Hystrix fallback uri is routed with incorrect "forward" scheme

Open OlgaMaciaszek opened this issue 8 years ago • 3 comments

With the following config where lb:ingredients is being resolved to localhost:9994:

spring:
    cloud:
        gateway:
            routes:
            - id: ingredients
              uri: lb://ingredients
              predicates:
              - Path=//ingredients/**
             filters:
             - name: Hystrix
               args:
               name: fetchIngredients
               fallbackUri: forward:/fallback
           - id: ingredients-fallback
             uri: lb://ingredients
             predicates:
             - Path=/fallback

When the fallback path is triggered and passess through the LoadBalancerClientFilter, the forward scheme is passed on to the filtered request (specifically, via LoadBalancerContext and the reconstructURIWithServer method) and the final post is being made to forward:localhost:9994/fallback

which is reflected in the logs: o.s.c.g.filter.LoadBalancerClientFilter : LoadBalancerClientFilter url chosen: forward://localhost:9994/fallback

OlgaMaciaszek avatar Nov 09 '18 16:11 OlgaMaciaszek

Has this problem of #871 been solved?

liuhui-hust avatar May 10 '19 09:05 liuhui-hust

Please stop commenting on multiple issues

spencergibb avatar May 10 '19 09:05 spencergibb

Ok, thank you

liuhui-hust avatar May 10 '19 09:05 liuhui-hust