Class PassRoute

java.lang.Object
org.zalando.riptide.PassRoute
All Implemented Interfaces:
Route

@API(status=STABLE) public final class PassRoute extends Object implements Route
  • Method Details

    • execute

      public void execute(org.springframework.http.client.ClientHttpResponse response, MessageReader reader) throws IOException
      Description copied from interface: Route
      Executes this route against the specific response. It's within the responsibility of a route implementation to ensure the stream is consumed (optional) and properly closed. A fully consumed response stream allows for connection reuse and is therefore highly encouraged. Making sure that every response is properly closed ensures that stale connections are not exhausting the connection pool. Most routes will do both operations internally, but the responsibility can be handed over to the caller of the route by unmarshalling the stream into a Closeable or AutoCloseable bean.
      Specified by:
      execute in interface Route
      Parameters:
      response - the client response
      reader - a utility to unmarshall the response into Java beans
      Throws:
      IOException
    • pass

      public static Route pass()
      Produces a Route that ignores the response by actively discarding the response body. Beware that this behavior will block forever on potentially endless response bodies like streams.
      Returns:
      a route that doesn't execute any meaningful logic