gateway version above 4.1.6 local rest handler stopped working
Describe the bug my gateway app has local rest handler, they were working very well with version of gateway 4.1.6 and before 4.1.6, above 4.1.6 local rest handler stopped working.
Sample
with these in pom
@Bean
public RouteLocator myRoutes(RouteLocatorBuilder builder) {
return builder.routes()
.route("facadeCheckBodyV3",
r -> r.method("POST").and()
.path("/api/v3/facades/itp-v3-emulator/dell/dependantpricingcatalog/**")
.or().path("/api/v4/facades/itp-v3-emulator/dell/dependantpricingcatalog/**").and()
.readBody(String.class, requestBody -> true)
.filters(f -> f.filter(facadeFilter)).uri("no://op"))
r -> r.path("/v3/api-docs").or().path("/v3/api-docs/swagger-config")
.filters(f -> f.filter(swaggerFilter)).uri("no://op"))
.route("check-query", r -> r.path("/**").filters(f -> f.filter(queryFilter)).uri("no://op"))
.build();
this routing also not working above gateway version 4.1.6
@RestController public class ForwardedToController { private static final Logger logger = LoggerFactory.getLogger(ForwardedToController.class)
@GetMapping("/health")
public ResponseEntity<String> health() {
return ResponseEntity.ok("{\"status\": \"OK\"}");
}
}
local rest handler
@chengtangzheng2021 please stop closing and opening new issues. One will suffice, with editing or new comments.
If you'd like us to spend some time investigating, please take the time to provide a complete, minimal, verifiable sample (something that we can unzip attached to this issue or git clone, build, and deploy) that reproduces the problem. Random bits of code in comments is not sufficient.
got it working, some dependencies versions issue
got it working, some dependencies versions issue
Me too facing an issue relating to no://op after migrating to Spring Cloud 2025.0.0.
Curious, what was the fix in your case?
spring.cloud.gateway:
routes:
- id: nopGateway
uri: no://op
changed to
spring.cloud.gateway:
server.webflux.routes:
- id: nopGateway
uri: no://op
By some reason, org.springframework.cloud.gateway.route.RouteDefinitionRouteLocator#loadGatewayFilters is not getting called for id nopGateway