-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UpstreamPathTemplate.Priority can be zero only when UpstreamPathTemplate is "/url" #270
Comments
@zpf1989 Thanks for your interest in the project. I think the only way to do this would be exposing the priority so you can configure it yourself. I think this is probably OK. I will have a look at it ASAP! If you cannot wait then I suggest setting up specific ReRoutes for all of your endpoints rather than the /xxx/{catchAll} style! |
OK,setting up specific ReRoutes for all endpoints may increase the difficulty of maintenance,since our endpoints will be a lot,and they probably are dynamic configured in our case. |
@zpf1989 I've just released version 5.0.1 to NuGet...when this becomes available please give it a try. You can now set the Priority. Please see updated docs http://ocelot.readthedocs.io/en/latest/features/routing.html#priority Let me know if this doesnt work! |
Yes,it works! |
Expected Behavior / New Feature
Make the Priority of UpstreamPathTemplate with value like "/goods/{url}" be zero too
Actual Behavior / Motivation for New Feautre
First,thanks for your great job!Ocelot is realy amazing!
Here is our case:
We have several microservice,each one has its unique service key,like orders、goods.
So we set UpstreamPathTemplate in general ReRoutes like below:
"UpstreamPathTemplate": "/orders/{url}"
"UpstreamPathTemplate": "/goods/{url}"
Now,we want to set a special ReRoute for a special action,so the UpstreamPathTemplate is like below:
"UpstreamPathTemplate": "/goods/delete"
However,when we call "/goods/delete",it always matches "/goods/{url}"
I have checked the code in Ocelot.Configuration.Creator.UpstreamTemplatePatternCreator.cs(
Ocelot/src/Ocelot/Configuration/Creator/UpstreamTemplatePatternCreator.cs
Line 33 in 16c70e8
and found that the UpstreamPathTemplate supports Piority setting,and I saw the purpose is to set "/{url}" to low level when matching(in method ForwardSlashAndOnePlaceHolder).
But,it only supports "/{url}".
So,is this for special consideration? Or could you make the Priority of UpstreamPathTemplate with value like "/goods/{url}" be zero too?
Tanks for your time!
Good luck!
Remarks:We are using the 5.0.0 release.
The text was updated successfully, but these errors were encountered: