问题
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