Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

feat: introduce HttpJsonClientCall, Listeners infrastructure and ServerStreaming support in REST transport #1599

Merged
merged 8 commits into from
Jan 21, 2022

Commits on Jan 12, 2022

  1. feat: Introduce HttpJsonClientCall, Listeners infrastructure and Serv…

    …erStreaming support in REST transport
    
    This includes the following changes for HTTP1.1/REST transport:
    1) `HttpJsonClientCall` class (with `HttpJsonClientCall.Listener`) mimicking [io.grpc.ClientCall](https://github.com/grpc/grpc-java/blob/master/api/src/main/java/io/grpc/ClientCall.java#L102) functionality.
    2) The unary callables are rewritten to be based on `HttpJsonClientCall` flow (similarly to how it is already done in grpc unary calls).
    3) Server streaming support for REST transport. The implementation is based on `HttpJsonClientCall` and `HttpJsonClientCall.Listener`, similarly to how grpc streaming is based on `io.grpc.ClientCall` and io.grpc.ClientCall.Listener` respectively.
    
    The extreme similarity between `HttpJsonClient` call and `io.grpc.ClientCall` is intentional and crucial for consistency of the two transports and also intends simplifying creation and maintenance of multi-transport manual wrappers (like [google-ads](https://github.com/googleads/google-ads-java/blob/main/google-ads/src/main/java/com/google/ads/googleads/lib/logging/LoggingInterceptor.java#L68)).
    
    The server streaming abstractions in gax java are all based on the flow control managed by a ClientCall, so having similar set of abstractions in REST transport is necessary to reuse transport-independent portions of streaming logic in gax and maintain identical user-facing streaming surface.
    
    This PR also builds a foundation for the soon-coming [ClientInterceptor](https://github.com/grpc/grpc-java/blob/master/api/src/main/java/io/grpc/ClientInterceptor.java#L42)-like infrastructure in REST transport.
    
    REST-based client-side streaming and bidirectional streaming is not implemented by this PR and most likely will never be due to limitations of the HTTP1.1/REST protocol compared to HTTP2/gRPC.
    
    Note, ideally I need to split this PR at least in two separate ones: 1) HttpJsonClientCall stuff and unary calls based on it in one PR and then 2) server streaming feature in a second PR. Unfortunately only reasonable way to test `HttpJsonClientCall` infrastructure is by doing it from server streaming logic beause most of the complexity introduced in HttpJsonClient call is induced by necessity to support streaming workflow.
    vam-google committed Jan 12, 2022
    Configuration menu
    Copy the full SHA
    c382b4a View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c86cf8b View commit details
    Browse the repository at this point in the history

Commits on Jan 14, 2022

  1. address PR feedback

    vam-google committed Jan 14, 2022
    Configuration menu
    Copy the full SHA
    d0faae4 View commit details
    Browse the repository at this point in the history

Commits on Jan 16, 2022

  1. Configuration menu
    Copy the full SHA
    27748aa View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2e2da06 View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2022

  1. Configuration menu
    Copy the full SHA
    0f7edc8 View commit details
    Browse the repository at this point in the history

Commits on Jan 21, 2022

  1. address PR feedback

    vam-google committed Jan 21, 2022
    Configuration menu
    Copy the full SHA
    912e504 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ad57564 View commit details
    Browse the repository at this point in the history