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: ![image](https://user-images.githubusercontent.com/19496093/45922181-efa6f880-be92-11e8-92b1-4f6daf756463.png) ![image](https://user-images.githubusercontent.com/19496093/45922183-02b9c880-be93-11e8-9565-fe8ef8908245.png) 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.
---