These are chat archives for spring-cloud/spring-cloud
@spencergibb about spring-cloud/spring-cloud-netflix#1235 I found those comment really interesting https://github.com/spring-cloud/spring-cloud-netflix/issues/435#issuecomment-191326711 about reusing
url property and adding same feature as
That should allow user to customize easily the route.
For example for issue spring-cloud/spring-cloud-netflix#435 we can resolve solution by adding such configuration:
zuul: routes: uaa-service: path: /user/** url: http://uaa-service/uaa strip-prefix: false
or even this one should work
zuul: routes: uaa-service: path: /user/** url: http://uaa-service/uaa/user strip-prefix: true
Regarding spring-cloud/spring-cloud-netflix#1235 something like
zuul: routes: user-service: path: /api/users/** url: http://user-service/users strip-prefix: true image-service: path: /api/images/** url: http://image-service/images strip-prefix: true web-service path: /web/login/** url: http://web-service/login strip-prefix: true
X-Forwarded-Prefix simply apply such logic:
strip-prefix: false nothing to do,
prefix will be the same.
strip-prefix: true retrieves previous logic from
PreDecorationFilter + prepend with
However there is just one point:
How to switch determine if url is normal URL or with register serviceId?
I was thinking about adding new properties on
boolean loadBalanced. Thus each previous sample should add:
zuul: routes: uaa-service: path: /user/** url: http://uaa-service/uaa strip-prefix: false load-balanced: true
load-balanced can be default
false but if true it will simply switch from
RibbonRoutingFilter that will activate both load balancing (service discovery) and circuit breaking
Do you think it could be a good solution for fixing both issues?
load-balancedcould be strange if is set to
url) because it's no sense. A validation can be done on
ZuulPropertiesto avoid that contradiction
urlon same route.
ZuulFilterall above is working (except that I break standard url, because I activate it by default... just a poc). I was thinking about
fallbackstrategy that try to get
serviceIdif fail fallback to standard request