-
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
(4.0.x) Enhance "/actuator/gateway" endpoint #3163
(4.0.x) Enhance "/actuator/gateway" endpoint #3163
Conversation
public AbstractGatewayControllerEndpoint(RouteDefinitionLocator routeDefinitionLocator, | ||
List<GlobalFilter> globalFilters, List<GatewayFilterFactory> gatewayFilters, | ||
List<RoutePredicateFactory> routePredicates, RouteDefinitionWriter routeDefinitionWriter, | ||
RouteLocator routeLocator) { | ||
RouteLocator routeLocator, WebEndpointProperties webEndpointProperties) { |
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.
I should have noticed this before, but can we deprecate the old constructor and create a new one? I just dont want to introduce any breaking changes.
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.
If I keep the deprecated constructor, I would not be able to inject a WebEndpointProperties
bean. So I was thinking of simply creating a new instance, where the base path would be fixed to /actuator
.
- The classes extending this class,
GatewayControllerEndpoint
andGatewayLegacyControllerEndpoint
would use the new constructor that handles the base path being overriden - anyone else extending this class via the deprecated constructor would be fixed to
/actuator
Does this seem ok?
@Deprecated
public AbstractGatewayControllerEndpoint(RouteDefinitionLocator routeDefinitionLocator,
List<GlobalFilter> globalFilters, List<GatewayFilterFactory> gatewayFilters,
List<RoutePredicateFactory> routePredicates, RouteDefinitionWriter routeDefinitionWriter,
RouteLocator routeLocator) {
this(routeDefinitionLocator, globalFilters, gatewayFilters, routePredicates,
routeDefinitionWriter, routeLocator, new WebEndpointProperties());
}
public AbstractGatewayControllerEndpoint(RouteDefinitionLocator routeDefinitionLocator,
List<GlobalFilter> globalFilters, List<GatewayFilterFactory> gatewayFilters,
List<RoutePredicateFactory> routePredicates, RouteDefinitionWriter routeDefinitionWriter,
RouteLocator routeLocator, WebEndpointProperties webEndpointProperties) {
this.routeDefinitionLocator = routeDefinitionLocator;
this.globalFilters = globalFilters;
this.GatewayFilters = gatewayFilters;
this.routePredicates = routePredicates;
this.routeDefinitionWriter = routeDefinitionWriter;
this.routeLocator = routeLocator;
this.webEndpointProperties = webEndpointProperties;
}
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.
yes that seems right
…roperties - the classes extending this class, `GatewayControllerEndpoint` and `GatewayLegacyControllerEndpoint`, use the new constructor that handles the base path being overridden - any other classes using the deprecated constructor would use the fixed base path `/actuator`
To replace #3147, since I do not have access to Marta's repo
Solves: #3128