-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[ Question / Feature Request] Complex Prefixes #1235
Comments
There are many routing requests about, such as #435. You can always write your own |
@spencergibb the fact that routing requests become more and more present, we can think about proposing a programmatic interface to write your custom routing rules? Something less generic than |
@kakawait we're open to suggestions. |
@spencergibb I'm working on it (solution not suggestions) |
@kakawait - can you share you're solution (idea), so I'll know if it should work for me as well? |
@matanshukry you could try that filter https://gist.github.com/kakawait/e1b5c67a9a262a684c5d0f3c2b61ae4d ATTENTION is just a POC/workaround (not heavily tested) and it will break any In your case try following configuration
If any issue with this filter please continue discussion on gist Is just a workaround we need to think about how to integrate it inside core. Moreover in addition to extend routing capability, zuul should be able to be more configurable, for example by allowing circuit breaking on plain old url... |
@kakawait What is the novelty in your suggestion? I though you can already do this kind of routing configuration. |
I see. I was confused because the original description mentions complex prefixes. I think the fundamental question here is whether Zuul shall remain simple and mainly do coarse grained routing out of the box, or be enhanced with API Editing features. For API Editing I would take a look at AWS API Gateway. It is quite straight forward in what it does.
|
@aivans agree with that. If you (community + core dev) think that zuul routing configuration should keep simple no problem and simply close all related issues by proposing user to write it own |
@kakawait Just expressing my opinion. |
My last comment may a bit too "direct". What I want to said is just I'm open to any options 👍 BTW a custom |
@kakawait no worries |
I would like to start an initiative where we can build an API Manager on top of Zuul together. I have an initial idea, but I would like more people to contribute. anyone interested? |
@aivans I am :-) |
cool. What would be the best structure to work together? |
@aivans Besides from sub domain redirections, what kind of features you have in mind that Zuul and Eureka cannot handle ? Access management ? |
@aivans Same but not before 3 weeks (vacancies are starting :)) |
When I said API Manager, I meant an API Designer that allows designing API-s and expose them on top of Zuul/Spring Cloud. |
Sounds interesting, actuators provides plenty of KPI that can be used by this API Manager. count me in ;) |
cool |
@aivans PR's are nice because of the communication features. |
Hi guys, it was bank holiday here and I didn't have time to write down my thoughts. I'll do it in the coming days. |
I would like to kick off the discussion by expressing my thoughts. Zuul provides the foundation for building an API Gateway (routing, load balancing, ...) The main challenge faced by Microservice Architectures (IMO) is in exposing the microservices API-s to external clients in a coherent manner.
This is where the current solution based on Zuul starts to show its limits. First I would like to hear what other people think about this. |
Great work seems to be happening here: https://github.com/gravitee-io Here is an example how to define an API: There is also a Swagger Importer. |
In a few words, after doing more research and thinking, I think that SC Zuul can be enhanced in order to support features available in API Management Tools. Generally API Management tools offer a complete end to end solution for building and monetizing an API from scratch. Additionally they offer all kind of connectors (Salesforce, SAP, ...) and integration with Identity Providers. My opinion is that SC Zuul should keep it simple.
Should not do the following:
The high level Architecture and Design I have in mind is in line with the MSA style and relying n proper Continuous Delivery practices and tools. This means that everything goes through a proper delivery pipeline (origin services, api gateway, etc) versus some invented persons (Alice the Produuct Manager, John Solution Architect, etc) dragging and dropping stuff in a GUI. The corner stone of the Design would be an API Definition artifact (Swagger, Raml, etc). The advantages of such a design are:
Any opinions so far? |
Globally agree with that, key point is to keep Zuul simple (routing) but with fully customizable and user friendly (cf idea of definition file you just proposed). |
Some rambling thoughts
https://apiblueprint.org is similar to swagger and RAML. I'm not convinced that having the API gateway know about all API's is a good thing. In other words, one gateway api spec to rule them all might not be optimal. I'd prefer if backing services were still in control.
I don't that that is absolutely required. It also may end up somewhere else in the spring cloud ecosystem that could be exposed through zuul. |
Thanks for the comments. The documentation can live somewhere else technically speaking. The services are in control since they are providing the API spec and are responsible for the actual implementation. The main point is that the API Gateway handles a few concerns like Rate Limiting at the edge and these concerns require fine grained endpoint knowledge in order to be really useful. The API spec provided and interpreted by the API Gateway may provide this granularity. |
@aivans @spencergibb Regarding --> intensive manipulation of requests/responses: Transformations (I will explain shortly). Does Zuul support transformations (request/response) currently? By design API Gateway probably does all the custom transformations needed and if Zuul doesn't support do we have any work around for the same. Also in case if we wanted to send a context of user session data how can we send it to back end services, currently i can add the data in Zuul Headers but i feel its too much to add user context/session data to headers. Please let me know your comments. |
@stiyyagura in custom filters you can do anything you want since you have access to the request and response. Not sure this fits in complex prefixes discussion though. |
@spencergibb I felt that zuul having different templates for transformation may help everyone something like we have in AWS gateway. Not really sure if this is correct thought process. |
@stiyyagura keep the transformation conversation to #1733 |
This module has entered maintenance mode. This means that the Spring Cloud team will no longer be adding new features to the module. We will fix blocker bugs and security issues, and we will also consider and review small pull requests from the community. |
I would like to have 2 "groups" of routes in my configuration:
(1), a group that starts with /api, which will be stripped.
e.g.
(2) A group that starts with /web, which will be stripped
It seems each one of those options is possible by it's own, using a global prefix (either "/api" or "/web"), and strip-prefix (set to false) at the service level. However, how can I achieve them both in the same zuul?
If it's not possible, what you guys think about this as a feature?
The text was updated successfully, but these errors were encountered: