Annotation Type Rpc


@Retention(CLASS) @Target(METHOD) public @interface Rpc

Binds a method to a gRPC RPC: a GrpcClient interface method in an application or a backend, or a method of a backend @GrpcService. The value is the gRPC method name (e.g. SayHello) and is combined with the interface-level GrpcClient.value() to form /<service>/<method>. The optional service() overrides the interface-level service path for a single method (useful when an interface aggregates calls into multiple services).

Applications call unary RPCs only (gRPC-Web carries no client streaming). A backend supports all four shapes; it infers the shape from the method signature.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The gRPC method name as declared in the .proto rpc line, e.g.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Optional override of the interface-level service path.
  • Element Details

    • value

      String value
      The gRPC method name as declared in the .proto rpc line, e.g. SayHello. Joined to the service path via /.
    • service

      String service
      Optional override of the interface-level service path. Empty string means inherit from GrpcClient.value().
      Default:
      ""