org.zalando.riptide.DispatchPlugin 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 lombok.AllArgsConstructor;
import static org.zalando.fauxpas.FauxPas.throwingFunction;
@AllArgsConstructor
final class DispatchPlugin implements Plugin {
private final MessageReader reader;
@Override
public RequestExecution aroundDispatch(final RequestExecution execution) {
return arguments -> execution.execute(arguments)
.thenApply(throwingFunction(response -> {
try {
arguments.getRoute().execute(response, reader);
} catch (final NoWildcardException e) {
throw new UnexpectedResponseException(response);
}
return response;
}));
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy