in src/main/java/org/apache/sling/distribution/journal/impl/publisher/DistributionPublisher.java [259:277]
private DistributionResponse send(final PackageMessage pkg, int queueSize, int delayMS) throws DistributionException {
try {
long offset = Timed.timed(publishMetrics.getEnqueuePackageDuration(), () -> this.sendAndWait(pkg));
publishMetrics.getExportedPackageSize().update(pkg.getPkgLength());
publishMetrics.getAcceptedRequests().mark();
String msg = format("Request accepted with distribution package %s at offset=%d, queueSize=%d, queueSizeDelay=%d", pkg, offset, queueSize, delayMS);
distLog.info(msg);
return new SimpleDistributionResponse(ACCEPTED, msg, pkg::getPkgId);
} catch (Throwable e) {
publishMetrics.getDroppedRequests().mark();
String msg = format("Failed to append distribution package %s to the journal", pkg);
distLog.error(msg, e);
if (e instanceof Error) {
throw (Error) e;
} else {
throw new DistributionException(msg, e);
}
}
}