Hi all,
I am hoping I can get some help with this. I have a process that's sending a set of JSON records to a NiFi flow. Each JSON record in the array is a set of criteria/conditions for which I run QueryElasticSearchHTTP to get matching records from ElasticSearch. I am using a Merge Content processor at the end to merge all of this data and send back the JSON array as response.
It works fine when for example I send 10 JSON criteria records in the array and QueryElasticSearchHTTP is able to find a document in the index for each criteria it receives. It bundles up the 10 resultant records from Elastic and sends the response through. However, if QueryElasticSearchHTTP finds only 8 records matching the criteria, it then waits forever at the Merge Content processor. I realise this is because it has received 10 records initially and split them into 10 flow files. When it looks to merge, it finds only 8 flow files and is waiting for the remaining 2 which never come through. This blocks up the entire flow and nothing works from here on.

Please see picture above. Can anyone help me with a solution to this, please? Thanks in advance.