fantiq commented on PR #15450: URL: https://github.com/apache/dubbo/pull/15450#issuecomment-2966218763
@oxsean The change request has been resolved, and there are more scenarios to consider. if the service class extends `abstract class *ImplBase`, There are several scenarios when `service class` and `MethodDescriptor` match method parameters: No.|service class method signatures|service class parameters|MethodDescriptor parameters --|--|--|-- `#1`|CompletableFuture<HelloReply> sayHelloAsync(HelloRequest)|[HelloRequest]|[HelloRequest] `#2`|HelloReply sayHello(HelloRequest)|[HelloRequest]|[HelloRequest] `#3`|sayHello(HelloRequest, StreamObserver<HelloReply>)|[HelloRequest, StreamObserver<HelloReply>]|[HelloRequest] `#4`|sayServerStream(HelloRequest, StreamObserver<HelloReply>)|[HelloRequest, StreamObserver<HelloReply>]|[HelloRequest] `#5`|StreamObserver<HelloRequest> sayClientStream(StreamObserver<HelloReply>)|[StreamObserver<HelloReply>]|[HelloRequest] `#6`|StreamObserver<HelloRequest> sayBIStream(StreamObserver<HelloReply>)|[StreamObserver<HelloReply>]|[HelloRequest] 1. `#1` and `#2` can be matched directly without any parameter processing 2. `#3` and `#4` need to ignore the last parameter of type `StreamObserver` before matching After removing the last parameter, `#3` is the same as `#2`. the request path `/org.apache.dubbo.demo.stream.StreamService/sayHello` will get error `Ambiguous mapping for '/org.apache.dubbo.demo.stream.StreamService/sayHello'` if `#3` register RequestMapping. `#2` and `#1` have the same purpose. `#2` should not be registered here. 3. `#5` and `#6` method has only one parameter of type `StreamObserver`, the parameter type required for matching is `HelloRequest`. This needs to be obtained from the generic type of the return parameter type StreamObserver I added a stream-based http2 call scenario in the module `dubbo-demo-spring-boot-idl-provider`, which can cover the above scenario. by the way, `org.apache.dubbo.metadata.MetadataService` will also register RequestMapping,The registration status is as follows: before modification: KeyString|count of Registration --|-- /org.apache.dubbo.metadata.MetadataService/version | 1 /org.apache.dubbo.metadata.MetadataService/serviceName | 1 /org.apache.dubbo.metadata.MetadataService/getMetadataURL | 1 /org.apache.dubbo.metadata.MetadataService/getMetadataInfos | 1 /org.apache.dubbo.metadata.MetadataService/getMetadataInfo | 1 /org.apache.dubbo.metadata.MetadataService/getExportedServiceURLs | 1 /org.apache.dubbo.metadata.MetadataService/getSubscribedURLs | 1 /org.apache.dubbo.metadata.MetadataService/getServiceDefinition | 2 /org.apache.dubbo.metadata.MetadataService/getExportedURLs | 5 after modification: KeyString|count of Registration --|-- /org.apache.dubbo.metadata.MetadataService/version | 1 /org.apache.dubbo.metadata.MetadataService/serviceName | 1 /org.apache.dubbo.metadata.MetadataService/getMetadataURL | 1 /org.apache.dubbo.metadata.MetadataService/getMetadataInfo | 1 /org.apache.dubbo.metadata.MetadataService/getMetadataInfos | 1 /org.apache.dubbo.metadata.MetadataService/getExportedServiceURLs | 1 /org.apache.dubbo.metadata.MetadataService/getSubscribedURLs | 1 /org.apache.dubbo.metadata.MetadataService/getServiceDefinition | 2 /org.apache.dubbo.metadata.MetadataService/getExportedURLs | 5 The two are consistent. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@dubbo.apache.org For additional commands, e-mail: notifications-h...@dubbo.apache.org