0

I am trying to use the EnforceOrder processor to do a Merge in a determinate order. To do so, this is my flow: enter image description here

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'.

enter image description here

And then the configuration of the EnforceOrder is the nextone:

enter image description here

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

jmarco10
  • 451
  • 1
  • 7
  • 21

1 Answers1

3

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:

enter image description here

EnforceOrderConfigs: enter image description here

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

notNull
  • 30,258
  • 4
  • 35
  • 50
  • Can you put an example of the configuration of the updateattribute and the EnforceOrder? I am only having one output instead of two. – jmarco10 Dec 12 '18 at 17:15
  • @jmarco10, That's intresting, in question there is another dataflow so i thought you are having another flowfile. Could you please update the `question` with more details about your flow and how your `input flowfile` going to `Enforce Order` and `expected output`. – notNull Dec 12 '18 at 18:46
  • @jmarco10, Please checkout my Edited answer's **`UPDATE`** section. – notNull Dec 13 '18 at 20:59