Skip to content

Commit

Permalink
issue #932: skip index document
Browse files Browse the repository at this point in the history
  • Loading branch information
mrk-vi authored and danielecalda committed Jun 3, 2024
1 parent 239c2f5 commit 43e92f2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand All @@ -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) {
Expand Down

0 comments on commit 43e92f2

Please sign in to comment.