#StackBounty: #spring-cloud #spring-cloud-gateway How to pass RouteLocatorBuilder route to specific uri

Bounty: 50

I have written a route builder like following

fun gateways(rlb: RouteLocatorBuilder): RouteLocator {
    return rlb.routes()
        .route { 

this works fine. But when I change the path but keep the uri same I get 404 when I visit the /userlist from browser


I look in the debug log and see it is querying /userlist in the downstream.

2021-07-09 20:53:10.697 DEBUG 5616 --- [ctor-http-nio-5] r.netty.http.client.HttpClientConnect    : [id:bd31ce68-1, L:/ - R:localhost/] Handler is being applied: {uri=http://DESKTOP-AM2LB9I:8081/userlist, method=GET}

Why is this happening?

What is the right way to write this?

Spring boot version "2.5.3"

Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.