@Nullable
    @UnstableApi
    default ServerMethodDefinition<?, ?> methodDefinition(ServiceRequestContext ctx) {
        final Route mappedRoute = ctx.config().mappedRoute();
        // method is found using mappedRoute when the grpcService is set via:
        // - serverBuilder.service(grpcService);
        // - serverBuilder.serviceUnder("/prefix", grpcService);
        final ServerMethodDefinition<?, ?> method = methodsByRoute().get(mappedRoute);
        if (method != null) {
            return method;
        }
        // method is found using methodName when the grpcService is set via route builder:
        // - serverBuilder.route().pathPrefix("/prefix")...build(grpcService);
        final String methodName = GrpcRequestUtil.determineMethod(ctx);
        if (methodName == null) {
            return null;
        }

        return methods().get(methodName);
    }
Returns the {@link ServerMethodDefinition} of the current request.
grpc/src/main/java/com/linecorp/armeria/server/grpc/GrpcService.java