Skip to content

airframe-http: Use HttpMessage.Request/Response as the standard interface #2167

@xerial

Description

@xerial

Historically, we needed to manage various http request/response types of Finagle, OkHttp, etc. Now that airframe-http has its own HttpMessage.Request/Response types, we should be able to wrap backend-specific request/response types into the unified http requests and responses.

Converting backend specific requests (e.g., Fingagle request) to HttpMesage.Request is not expensive. Currently, using backend-specific implementation has much higher cost.

Projects using backend-specific request/response types:

  • airframe-http-okhttp
  • airframe-http-finagle
  • airframe-http-recorder
  • airframe-http-grpc

Benefits:

  • We can use the same filters both for finagle and gRPC (e.g., auth filter, header manipulation filter, etc.)
  • Simplify the usage of http-recorder, okhttp, etc.

Steps:

  • Add a new factory methods in each projects
  • Preserve the current interfaces for a while so as not to break the existing code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions