Class Vertx5HttpResponse

  • All Implemented Interfaces:
    HttpHeaders, HttpResponse<AsyncBody>

    public class Vertx5HttpResponse
    extends StandardHttpHeaders
    implements HttpResponse<AsyncBody>
    Vert.x 5 implementation of HttpResponse for the Fabric8 Kubernetes Client.

    Bridges Vert.x 5's HttpClientResponse with Fabric8's HTTP abstraction, providing case-insensitive headers and async body streaming for Kubernetes operations like pod logs, exec sessions, and watch operations.

    Thread-safe and immutable once constructed. The AsyncBody must be consumed or cancelled to prevent resource leaks.

    Since:
    7.6.0
    • Method Detail

      • code

        public int code()
        Returns the HTTP status code from the underlying Vert.x response.
        Specified by:
        code in interface HttpResponse<AsyncBody>
        Returns:
        the HTTP status code (e.g., 200, 404, 500)
      • body

        public AsyncBody body()
        Returns the async response body for streaming consumption.

        Provides non-blocking access with backpressure support, ideal for streaming Kubernetes operations like pod logs, exec sessions, and watch operations. The body must be consumed or cancelled to prevent resource leaks.

        Specified by:
        body in interface HttpResponse<AsyncBody>
        Returns:
        the async body for streaming data consumption
      • request

        public HttpRequest request()
        Returns the original HTTP request that initiated this response. Useful for debugging, correlation, and retry logic.
        Specified by:
        request in interface HttpResponse<AsyncBody>
        Returns:
        the original HTTP request
      • previousResponse

        public Optional<HttpResponse<?>> previousResponse()
        Returns the previous response in an HTTP redirect chain.

        Currently always returns empty as redirect chain tracking is not implemented. Redirects are rare in Kubernetes API contexts.

        Specified by:
        previousResponse in interface HttpResponse<AsyncBody>
        Returns:
        empty Optional