Support Questions

Find answers, ask questions, and share your expertise

How to configure mergecontent in nifi to merge only when flowfiles are received from all the sources?

nifi-flow.png@Matt Clarke @Matt Burgess@bryanbende

Hi All,

Could you please suggest me : How to configure Mergecontent processor in nifi so that it doesn't merge files until it recieves atleast one file from all the upstream connections? As if i have set #Min Entries = 2, the processor will merge the flowfiles even when both the flowfiles are from a same upstream connection.

My scenario is: i am fetching two xmls from two tables and want to compare both the xml content for which i need to merge the flowfiles so that i can compare its content stored in attributes.

Please find attached the screenshot of the flow and mergecontent configurations.

Please suggest what i am doing wrong?

Thanks in advance !!



Super Guru

If you can set the flow files on one connection to have an attribute with odd numbers and the other connection to have even numbers, then you could use EnforceOrder before MergeContent. EnforceOrder can be configured to wait for an attribute value like "1", then it will not process a flow file with attribute value "3" until it has processed one with attribute value "2".