(4.0.x) Enhance "/actuator/gateway" endpoint#3163
Merged
ryanjbaxter merged 5 commits intospring-cloud:4.0.xfrom Dec 5, 2023
Merged
(4.0.x) Enhance "/actuator/gateway" endpoint#3163ryanjbaxter merged 5 commits intospring-cloud:4.0.xfrom
ryanjbaxter merged 5 commits intospring-cloud:4.0.xfrom
Conversation
ryanjbaxter
reviewed
Dec 5, 2023
| List<GlobalFilter> globalFilters, List<GatewayFilterFactory> gatewayFilters, | ||
| List<RoutePredicateFactory> routePredicates, RouteDefinitionWriter routeDefinitionWriter, | ||
| RouteLocator routeLocator) { | ||
| RouteLocator routeLocator, WebEndpointProperties webEndpointProperties) { |
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
There was a problem hiding this comment.
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,
GatewayControllerEndpointandGatewayLegacyControllerEndpointwould 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;
}…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`
ryanjbaxter
approved these changes
Dec 5, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To replace #3147, since I do not have access to Marta's repo
Solves: #3128