org.zalando.riptide.NoopRoute Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of riptide-core Show documentation
Show all versions of riptide-core Show documentation
Client side response routing
The newest version!
package org.zalando.riptide;
import org.apiguardian.api.API;
import org.springframework.http.client.ClientHttpResponse;
import static org.apiguardian.api.API.Status.STABLE;
@API(status = STABLE)
public final class NoopRoute implements Route {
private static final Route NOOP = new NoopRoute();
private NoopRoute() {
}
@Override
public void execute(
final ClientHttpResponse response, final MessageReader reader) {
// nothing to do
}
/**
* Produces a {@link Route} that ignores the response without actively
* discarding the response body.
*
* Beware that the returned response needs be closed
* manually in all cases, otherwise the bound connection may not be
* released back to the pool.
*
* @return a {@link Route route} that doesn't execute any meaningful logic
*/
public static Route noop() {
return NOOP;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy