spring-cloud-gateway icon indicating copy to clipboard operation
spring-cloud-gateway copied to clipboard

How to delete or update RouteLocator

Open jiedada opened this issue 1 year ago • 1 comments

@Bean @Order public RouteLocator customRouteLocator(RouteLocatorBuilder builder) { return builder.routes() .route(MXH_LV_ROUTER, r -> r .path(mxhlyProxyUri) .filters(f -> f.stripPrefix(3).modifyRequestBody(String.class, String.class, MediaType.APPLICATION_JSON_VALUE, (exchange, requestBody) -> { String modifiedBody = modifyRequestBody(requestBody); return Mono.just(modifiedBody); }) ) .uri(mxhlyProxyHost) ) .build(); } The above is how I added RouteLocator. Is there any way to delete or update it while the system is running?

jiedada avatar Dec 12 '23 11:12 jiedada

I don't know which tool you want to use to change attributes. But I was thinking about one of the cases I solved earlier. Maybe this can help you.

Update the routes while the gateways are running with Apollo

ksewen avatar Jan 10 '24 19:01 ksewen

Configuration based properties can be updated or using a RouteDefinitionRepository

spencergibb avatar Mar 11 '24 22:03 spencergibb

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues avatar Mar 18 '24 22:03 spring-cloud-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

spring-cloud-issues avatar Mar 25 '24 22:03 spring-cloud-issues