Skip to content
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

Merged

Conversation

fombico
Copy link
Contributor

@fombico fombico commented Dec 5, 2023

To replace #3147, since I do not have access to Marta's repo
Solves: #3128

public AbstractGatewayControllerEndpoint(RouteDefinitionLocator routeDefinitionLocator,
List<GlobalFilter> globalFilters, List<GatewayFilterFactory> gatewayFilters,
List<RoutePredicateFactory> routePredicates, RouteDefinitionWriter routeDefinitionWriter,
RouteLocator routeLocator) {
RouteLocator routeLocator, WebEndpointProperties webEndpointProperties) {
Copy link
Contributor

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.

Copy link
Contributor Author

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 and GatewayLegacyControllerEndpoint 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;
	}

Copy link
Contributor

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`
@ryanjbaxter ryanjbaxter added this to the 4.0.9 milestone Dec 5, 2023
@ryanjbaxter ryanjbaxter merged commit b3abd52 into spring-cloud:4.0.x Dec 5, 2023
1 check passed
ryanjbaxter added a commit that referenced this pull request Dec 5, 2023
@ryanjbaxter ryanjbaxter linked an issue Dec 5, 2023 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Add links to child paths for /actuator/gateway endpoint
4 participants