Github user bdesert commented on a diff in the pull request:
https://github.com/apache/nifi/pull/2954#discussion_r219683471
--- Diff:
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/MergeRecord.java
---
@@ -304,13 +336,25 @@ public void onTrigger(final ProcessContext context,
final ProcessSessionFactory
session.commit();
}
+ // If there is no more data queued up, complete any bin that meets
our minimum threshold
+ int completedBins = 0;
+ final QueueSize queueSize = session.getQueueSize();
--- End diff --
@markap14
Test for MinRecords is successful, but actual flow doesn't work as expected
and still doesn't respect Min Records setting.
There is my set up:


The problem is in different behavior of MockProcessSession and
StandardProcessSession.
MockProcessSession.getQueueSize() will return 0, after session.get(...)
StandardProcessSession.getQueueSize() will return same number as before
session.get(...), regardless flow files have been polled or not.
As a result, this condition will block from actually emitting FF when min
requirements are reached.
I would recommend to change this condition to:
if (flowFiles.size() != 0) {...}
In parallel, we probably need to open a JIRA for inconsistency between
MockProcessSession and StandardProcessSession.
---