简体   繁体   中英

NiFi - Control de order merging two dataflows with EnforceOrder and MergeContent processor

I am trying to use the EnforceOrder processor to do a Merge in a determinate order. To do so, this is my flow: 在此处输入图片说明

In the updateAttribute, I am generating an attribute to set order I want in the merge. On the one of the left, I am setting the value '1' and on the other, I am setting the value of '2'.

在此处输入图片说明

And then the configuration of the EnforceOrder is the nextone:

在此处输入图片说明

The problem is that only arrives the flow of the process.order = 1 and is not taking out the number 2. What am I doing wrong?

Cheers

Use EnforceOrder processor to control the order of flowfiles reaching to MergeContent processor.

  • using UpdateAttribute processor add the sequence number to the flowfile.

Example:

  • Consider 2 flowfiles, Flowfile-2 (this content will need to showup first) will have lower sequence number compared to flowfile1 then feed the success connection to MergeContent processor, By using enforceorder processor we are making sure flowfile2 will be going to Mergecontent processor before flowfile1.

Please refer to this and use the enforce-order template to get familiar with the enforce order processor.

UPDATE:

I think the issue is with the EnforceOrder configs,

  • Group Identifier is configured as ${filename} so if you have two different filenames then processor doesn't wait for both of them.

  • To fix this Keep common attribute in UpdateAttribute processors like group_name as gn then use same attribute name in Group Identifier property value as ${group_name}

  • Connect Skipped and Wait connections to EnforceOrder processor it self.

UpdateAttributeConfigs:

在此处输入图片说明

EnforceOrderConfigs: 在此处输入图片说明

Please use this template as reference and upload it to your NiFi instance check out how the flow has been running.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM