MikeThomsen commented on a change in pull request #3315: NIFI-5916 Added an 
option to enable empty flowfiles to be sent if the…
URL: https://github.com/apache/nifi/pull/3315#discussion_r275131742
 
 

 ##########
 File path: 
nifi-nar-bundles/nifi-mongodb-bundle/nifi-mongodb-processors/src/main/java/org/apache/nifi/processors/mongodb/GetMongo.java
 ##########
 @@ -228,12 +249,19 @@ public void onTrigger(final ProcessContext context, 
final ProcessSession session
                     outgoingFlowFile = 
session.putAllAttributes(outgoingFlowFile, attributes);
                     session.getProvenanceReporter().receive(outgoingFlowFile, 
getURI(context));
                     session.transfer(outgoingFlowFile, REL_SUCCESS);
+                    sent++;
                 }
             }
 
             if (input != null) {
                 session.transfer(input, REL_ORIGINAL);
             }
+
+            if (sent == 0 && sendEmpty) {
+                FlowFile empty = session.create(input);
 
 Review comment:
   Ok. Fixed that.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to