-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Support CF Route Services #190
Comments
Header existence check added here 9d04c4e I believe ordering is taken advantage of https://github.com/spring-cloud/spring-cloud-gateway/blob/master/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/handler/FilteringWebHandler.java#L83 So the issue remains about URI. (nice blog post BTW). I'd propose that we build in support for this. You are not the first to ask, and folks liked your post. Make Thoughts? |
Cool, thanks for the quick updates, and I put in #192 for ordering. I think Adding in a I feel like the dynamic routing might have use cases beyond just the cf route service, would edit: |
I think dynamic is too generic since the filter is getting the URL from a cf specific header |
So with a global filter to manage the forwarded URL, a route might look something like this?
|
yup, or even |
Great! We also use the gateway as CF route service. So I can drop my workaround sooner or later. Thanks |
I've sent a PR so that we can change the url dynamically. |
The fix for spring-cloudgh-153 was sensible, but has now exposed another issue which is that the bootstrap initializers, whilst they are now only created once, actually only get applied to the parent context in a hierarchy. Most of the time this doesn't matter because the child contexts all benefit from environment changes and additional beans added to the parent. If the children are supposed to actually have different environments, though, there is a problem. So this change locates the existing bootstrap context and applies it to each new context created separately. Unfortunately we have to use reflection to do that for now because there is no way to discover the parent with a public API before the context is refreshed. See spring-cloudgh-190
I started writing this up as a post on the spring-cloud Gitter, but thought it might make more sense to post somewhere a little more permanent.
I recently wrote a blog post about using spring cloud gateway to create a route service. First off/selfishly, I was wondering if anyone had suggestions on alternate approaches I could/should have taken to implement the route service.
Secondly, I wanted to bring up a couple ergonomic issues and see if they would make sense to create separate issues/contributions for:
header
filter make sense? This would just check for the existence of a header... instead ofheader("X-My-Header", ".*")
, it would beheader("X-My-Header")
GatewayFilterSpec
:add
andfilter
both exist? It feels a little weird that they both exist w/ the same functionalityadd
andfilter
are meant to be aliases, should it be possible to specify an order usingadd
?addAll
? Adding multiple filters is currently a little awkwardOrdered
?The text was updated successfully, but these errors were encountered: