Open fuyongde opened 5 years ago
hi, sorry for the late reply.
It seems this is a bug, define another method with different params can solve it.
@mercyblitz , these two methods could not match right in DubboServiceMetadataRepository
:
@PutMapping(value = "/orders/{id}", params = "op=update")
@Override
public String update(@PathVariable Integer id, @RequestBody OrderUpdateRequest request) {
productRpc.update(id, new ProductUpdateRequest(id, "product name", 10000L, 20));
log.info("PUT product 4 update : id : {}, request {}", id, request);
return "UPDATE SUCCESS";
}
@PutMapping(value = "/orders/{id}", params = "op=revoke")
@Override
public String revoke(@PathVariable Integer id, @RequestBody OrderRevokeRequest request) {
productRpc.revoke(id, new ProductRevokeRequest(id, 1));
log.info("PUT product 4 revoke, id : {}, request : {}", id, request);
return "REVOKE SUCCESS";
}
I wrote a demo like
spring-cloud-dubbo-provider-web-sample
,but when I use the gateway to access dubbo service with dubbo protocol,it does not support route the right address that the same url with different params. You can access the demo. Start theproduct-service
、order-service
andgateway2
,then accesshttp://localhost:8083/dsc/order-service/orders/1?op=revoke
,it will route this request tohttp://localhost:8083/dsc/order-service/orders/1?op=update
. If your IDEA support.http
file, just use/gateway-demo/request.http
file. Hope to hear from you soon, sincerely.