Skip to content

(4.0.x) Enhance "/actuator/gateway" endpoint#3163

Merged
ryanjbaxter merged 5 commits intospring-cloud:4.0.xfrom
fombico:mmedio/4.0.x-actuator_gateway_endpoint
Dec 5, 2023
Merged

(4.0.x) Enhance "/actuator/gateway" endpoint#3163
ryanjbaxter merged 5 commits intospring-cloud:4.0.xfrom
fombico:mmedio/4.0.x-actuator_gateway_endpoint

Conversation

@fombico
Copy link
Copy Markdown
Contributor

@fombico fombico commented Dec 5, 2023

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

List<GlobalFilter> globalFilters, List<GatewayFilterFactory> gatewayFilters,
List<RoutePredicateFactory> routePredicates, RouteDefinitionWriter routeDefinitionWriter,
RouteLocator routeLocator) {
RouteLocator routeLocator, WebEndpointProperties webEndpointProperties) {
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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`
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

3 participants