use of io.knotx.server.configuration.RepositoryEntry in project knotx by Cognifide.
the class KnotxRepositoryHandler method handle.
@Override
public void handle(RoutingContext context) {
final Optional<RepositoryEntry> repositoryEntry = configuration.getDefaultFlow().repositoryForPath(context.request().path());
final KnotContext knotContext = context.get(KnotContext.KEY);
if (repositoryEntry.isPresent()) {
proxies.computeIfAbsent(repositoryEntry.get().address(), adr -> RepositoryConnectorProxy.createProxyWithOptions(vertx, adr, configuration.getDeliveryOptions())).rxProcess(knotContext.getClientRequest()).doOnSuccess(this::traceMessage).subscribe(repoResponse -> handleRepositoryResponse(repoResponse, context, repositoryEntry.get(), knotContext), context::fail);
} else {
context.fail(HttpResponseStatus.NOT_FOUND.code());
}
}
Aggregations