0
votes

I have a flow file that will take a couple different paths through a template, and I want to merge the results. My issue is that the flow files will all have the same content, just some different attributes based on the content.

I was wondering if its possible to merge two identical flow files using one of the Merge processors, but also have the single resultant flow file have all the attributes set from each individual input.

For example: flow file 1 has content "hello" and attribute "b = 4". flow file 2 has content "hello" and attribute "a = 3". I want the result flow file to have content "hello" and attributes "a = 3" and "b = 4". Is that possible in Nifi?

1

1 Answers

1
votes

The merge processors are meant to merge the content of flow files to create a large flow file. So in your example you would end up with the content of the flow file being "hellohello", or if you used a new-line demaractor then "hello\nhello".

You could probably create a custom processor, or use ExecuteScript, to only merge attributes. Something like this doesn't exist because it would only make sense if you assume the content of flow files to be the same, which is something that can't be assumed normally.