org.zalando.riptide.DispatchPlugin Maven / Gradle / Ivy
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 - 2025 Weber Informatics LLC | Privacy Policy