Support Questions

Find answers, ask questions, and share your expertise

Order of files Tared in MergeContent processor

avatar
Rising Star

I am trying to set an order to the files Tared in a merge content processor, is this possible somehow?

I need the order of the binary bits to be set so that one file (based on filename) can always be first.

In this case I need the testfile1.txt to be first and then then testfile2.txt to be second.

It seems to ignore my priorityattrbribute prioritizer.

Thank you!

1 ACCEPTED SOLUTION

avatar
Master Mentor
@John T

The PriorityAttributePrioritizer controls the order in which FlowFiles on a queue are read for processing by the next processor in a dataflow. In your case that next processor is a MergeContent processor which just places the FlowFile in a Bin and move on to the next priority FlowFile. There is no definable merging order with the TAR format in the NiFi MergeContent processor.

If you know the exact number of fragments that are going in to your bundle, you could try setting the fragment identifiers on the incoming FlowFiles to force a merging order.

13589-screen-shot-2017-03-13-at-102454-am.png

This would require you to change your merge strategy to "Defragment".

Thanks, Matt

View solution in original post

2 REPLIES 2

avatar
Master Mentor
@John T

The PriorityAttributePrioritizer controls the order in which FlowFiles on a queue are read for processing by the next processor in a dataflow. In your case that next processor is a MergeContent processor which just places the FlowFile in a Bin and move on to the next priority FlowFile. There is no definable merging order with the TAR format in the NiFi MergeContent processor.

If you know the exact number of fragments that are going in to your bundle, you could try setting the fragment identifiers on the incoming FlowFiles to force a merging order.

13589-screen-shot-2017-03-13-at-102454-am.png

This would require you to change your merge strategy to "Defragment".

Thanks, Matt

avatar
Rising Star

Thank you!! That worked perfectly! Feel free to check out my NiFi template where this is in use!

original-content-and-attributes-in-xmlv4.xml