-
Notifications
You must be signed in to change notification settings - Fork 2
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
Static routing definition for runtime apps, avoiding route refresh #179
Conversation
src/test/java/com/contentgrid/gateway/KubernetesServiceDiscoveryIntegrationTest.java
Outdated
Show resolved
Hide resolved
fa80ae0
to
ac17581
Compare
2454e09
to
ec58211
Compare
This branch is currently live/deployed on sandbox |
@Bean | ||
RouteLocator runtimeAppRouteLocator(RouteLocatorBuilder builder, RuntimeRequestResolver requestResolver) { | ||
return builder.routes() | ||
.route(r -> r |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this be a plain gateway configuration file? Something like
That would make it easier to add additional routes that do not forward to a specific application, and makes it easier to configure additional filters when that is necessary
spring:
cloud:
gateway:
routes:
- id: apps
uri: cg://ignored
predicates:
- ResolvesToApplication
filters:
- PreserveHostHeader
In that case, we would need to explicitly define a ResolvesToApplication
gateway predicate, but that's all.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be a static configuration via properties, yes.
- Given that
spring.cloud.gateway.routes
is a list, it is imo too easy to overwrite a route-definition by accident - makes runtime integration tests more finicky - now the behaviour is enabled with a single flag
contentgrid.gateway.runtime-platform.enabled: true
This can be revisited in the future.
No description provided.