Zuul dynamic routing

醉酒当歌 提交于 2019-12-12 04:39:45

问题


I am trying to use Zuul as an API Gateway, in one particular scenario I have to change URL, based on data coming from client. I can do most of the things using "pre" filter but so far I'm unable to read the configured URL in the route.

This is how my route looks like:

zuul:
  #prefix: /api
  sensitive-headers: Cookie,Set-Cookie,Authorization
  routes:
    mgmt:
      path: /test/abc/mgmt/**
      url: https://myserver:8080/{id}/

I want to replace id from from data received from client. As of now I am unable to read 'url' configured in the routes, in the filter may be I am not using the right API.


回答1:


Sorry for posting looks like I can get URL and other route attributes by autowiring

RouteLocator routeLocator;


来源:https://stackoverflow.com/questions/46424932/zuul-dynamic-routing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!