diff --git a/core/app/datasource/src/main/java/io/openk9/datasource/pipeline/actor/EnrichPipeline.java b/core/app/datasource/src/main/java/io/openk9/datasource/pipeline/actor/EnrichPipeline.java index a9dbaf730..68af7546a 100644 --- a/core/app/datasource/src/main/java/io/openk9/datasource/pipeline/actor/EnrichPipeline.java +++ b/core/app/datasource/src/main/java/io/openk9/datasource/pipeline/actor/EnrichPipeline.java @@ -323,6 +323,23 @@ else if (r instanceof EnrichItemSupervisor.Error) { newJsonPayload = result; } + if (newJsonPayload.getBoolean("_openk9SkipDocument", false)) { + + log.infof( + "Document with contentId %s can be skipped.", + dataPayload.getContentId() + ); + + replyTo.tell(new Success( + dataPayload.getContentId(), + consumer, + dataPayload.getScheduleId(), + dataPayload.getTenantId() + )); + + return Behaviors.stopped(); + } + DataPayload newDataPayload = mergeResponse( jsonPath, behaviorMergeType, dataPayload, diff --git a/core/app/resources-validator/src/main/java/io/openk9/resources/validator/ResourcesValidatorProcessor.java b/core/app/resources-validator/src/main/java/io/openk9/resources/validator/ResourcesValidatorProcessor.java index b539eecc8..dec743fc4 100644 --- a/core/app/resources-validator/src/main/java/io/openk9/resources/validator/ResourcesValidatorProcessor.java +++ b/core/app/resources-validator/src/main/java/io/openk9/resources/validator/ResourcesValidatorProcessor.java @@ -134,7 +134,7 @@ public JsonObject consume(ResourcesValidatorDataPayload resourcesValidatorPayloa "document found. dropped message with contentId: " + contentId); - return JsonObject.of("toIndex", true); + return JsonObject.of("_openk9SkipDocument", true); } } } @@ -143,7 +143,7 @@ public JsonObject consume(ResourcesValidatorDataPayload resourcesValidatorPayloa logger.info("Index wit name: " + indexName + " not exist. Item go to next enrich step."); } - return JsonObject.of("hashCodes", hashCodes, "toIndex", false); + return JsonObject.of("hashCodes", hashCodes, "_openk9SkipDocument", false); } catch (IOException e) {