From 57947cd2a205a522b3d929fde8c0cf102a7a59c6 Mon Sep 17 00:00:00 2001 From: Eduardo Fontes Date: Fri, 6 Mar 2020 16:06:21 -0300 Subject: [PATCH] Fiz writeBatch to avoid cycle in provenance graph --- .../nifi/processors/mongodb/AbstractMongoProcessor.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java index 43c210c5a9..df918d906c 100644 --- a/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java +++ b/nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/AbstractMongoProcessor.java @@ -347,7 +347,9 @@ public abstract class AbstractMongoProcessor extends AbstractProcessor { FlowFile flowFile = parent != null ? session.create(parent) : session.create(); flowFile = session.importFrom(new ByteArrayInputStream(payload.getBytes(charset)), flowFile); flowFile = session.putAllAttributes(flowFile, extraAttributes); - session.getProvenanceReporter().receive(flowFile, getURI(context)); + if (parent == null) { + session.getProvenanceReporter().receive(flowFile, getURI(context)); + } session.transfer(flowFile, rel); }