Class MethodTranscodingOptions


  • @Unstable("Transcoding is in tech preview")
    public class MethodTranscodingOptions
    extends Object
    Defines configuration options for transcoding HTTP requests to gRPC service calls. This interface provides the necessary mapping information to translate between HTTP and gRPC, including path templates, HTTP methods, body mappings, and additional bindings. The transcoding options define how incoming HTTP requests should be mapped to gRPC method calls, including:
    • Which gRPC service/method to call (selector)
    • What HTTP method and path pattern to match
    • How to map the HTTP request/response bodies to gRPC messages
    • Constructor Detail

      • MethodTranscodingOptions

        public MethodTranscodingOptions()
    • Method Detail

      • getSelector

        public String getSelector()
        Gets the fully-qualified name of the gRPC method to be called.
        Returns:
        The method selector string (e.g., "mypackage.MyService.MyMethod")
      • setSelector

        public MethodTranscodingOptions setSelector​(String selector)
        Set the fully-qualified name of the gRPC method to be called.
        Parameters:
        selector - the gRPC method
        Returns:
        this instance
      • getHttpMethod

        public io.vertx.core.http.HttpMethod getHttpMethod()
        Gets the HTTP method that this binding should match.
        Returns:
        The HTTP method (GET, POST, etc.)
      • setHttpMethod

        public MethodTranscodingOptions setHttpMethod​(io.vertx.core.http.HttpMethod httpMethod)
        Sets the HTTP method that this binding should match.
        Parameters:
        httpMethod - the HTTP method
        Returns:
        this instance
      • getPath

        public String getPath()
        Gets the URL path template for this binding.
        Returns:
        The path template string (e.g., "/v1/users/{user_id}")
      • setPath

        public MethodTranscodingOptions setPath​(String path)
        Sets the URL path template for this binding.
        Parameters:
        path - the path
        Returns:
        this instance
      • getBody

        public String getBody()
        Gets the field path where the HTTP request body should be mapped in the gRPC request message.
        Returns:
        The body field path or null if no body mapping is needed
      • setBody

        public MethodTranscodingOptions setBody​(String body)
        Sets the field path where the HTTP request body should be mapped in the gRPC request message.
        Parameters:
        body - the body
        Returns:
        this instance
      • getResponseBody

        public String getResponseBody()
        Gets the field path in the gRPC response message to use as the HTTP response body.
        Returns:
        The response body field path or null if no response body mapping is needed
      • setResponseBody

        public MethodTranscodingOptions setResponseBody​(String responseBody)
        Sets the field path in the gRPC response message to use as the HTTP response body.
        Parameters:
        responseBody - the response doby
        Returns:
        this instance
      • getAdditionalBindings

        public List<MethodTranscodingOptions> getAdditionalBindings()
        Gets additional HTTP bindings for the same gRPC method. This allows a single gRPC method to be exposed through multiple HTTP endpoints.
        Returns:
        A list of additional bindings, or an empty list if none exist