spring cloud gateway (Greenwich.SR2): how to route a request to a controller of itself ?

spring cloud gateway (Greenwich.SR2): how to route a request to a controller of itself ?

I write several controller http api to maintain the gateway configuration data in mysql. I write the Decryption/Encryption logic for the request/response in the Filters.
I wanna implement like this:
r.path("/gateway/**").uri( itself );
such as http://ip:port/gateway/addServiceInfo will route to the api of this/current instance:

MaintainController{
   @PostMapping("addServiceInfo")
   addServiceInfo(){
      //do something
   }
}```

1个回答

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问