<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Flowfile stuck in Wait in EnforceOrder processor in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Flowfile-stuck-in-Wait-in-EnforceOrder-processor/m-p/399902#M250570</link>
    <description>&lt;P&gt;Hi Matt,&lt;BR /&gt;thanks for your your answer.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;wrote:&lt;P&gt;From the look of your dataflows it appears you have two FlowFiles that you want to merge via the MergeContent processor.&amp;nbsp; The order in which they are merged is important to you.&amp;nbsp; This sounds like a use case better solved by using the "Defragment" merge strategy in the MergeContent processor rather then trying to use EnforceOrder processor.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Sorry for not mentioning this. My workflow starts with a series of API calls to obtain data, that is converted into xml fragments. With the merge processor, I am trying to merge those xml fragments into one final XML file. Hence the order is important.&lt;BR /&gt;The files can have different product_id attributes and I only want to merge files with the same product id. Therefore I am using the MergeProcessor with the Bin-Packing Algorithm. As far as I know (I just started using Nifi last month) it is not possible to control the order using this algorithm?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;wrote:&lt;P&gt;As far as your dataflow goes,&amp;nbsp; I am having trouble reproducing the issue you described.&lt;BR /&gt;I see my priority 2 file sitting in wait only until my matching priority 1 file arrives.&amp;nbsp;&lt;BR /&gt;The dataflow screenshot you shared also does not show a wait relationship being routed anywhere.&amp;nbsp; Are you using the "retry" + "terminate" checkboxes on the wait relationship instead?&amp;nbsp; If so, what are the retry settings configured?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;I hadn't configured the wait relationship yet. I was under the impression, the EnforceOrder processor would re-visit flowfiles in "wait" status once other priority 1 files have been processed.&lt;BR /&gt;&lt;BR /&gt;I routed the wait relationship to a RouteOnAttribute processor (is there another way?) which then routes back to EnforceOrder:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Chram_0-1736457213768.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/43411i5627EAFF78A47044/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Chram_0-1736457213768.png" alt="Chram_0-1736457213768.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The priority 2 file will now be processed, but the order, in which the files are merged, seems to be random. Sometimes its the correct order, sometimes its not.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 09 Jan 2025 21:20:00 GMT</pubDate>
    <dc:creator>Chram</dc:creator>
    <dc:date>2025-01-09T21:20:00Z</dc:date>
    <item>
      <title>Flowfile stuck in Wait in EnforceOrder processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Flowfile-stuck-in-Wait-in-EnforceOrder-processor/m-p/399894#M250566</link>
      <description>&lt;P&gt;Hi, I am trying to set up a workflow in Nifi, where I need to process Flowfiles in a specific order. To my understand, this is what the EnforceOrder processor was designed for.&lt;BR /&gt;&lt;BR /&gt;The part I am having problems with looks like this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Chram_0-1736443442679.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/43407i2F272B4B710005B2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Chram_0-1736443442679.png" alt="Chram_0-1736443442679.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;In Set Merge Priority I am setting a Merge Priority attribute (1 for the left node, 2 for the right node). I am also setting an Enforce property to group the EnforceOrder by:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Chram_1-1736443548473.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/43408iCD3D211DD24E6BBF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Chram_1-1736443548473.png" alt="Chram_1-1736443548473.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Chram_3-1736443631937.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/43410i232BC45C247ECFD3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Chram_3-1736443631937.png" alt="Chram_3-1736443631937.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;My EnforceOrder processor is configured as followed:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Chram_2-1736443588920.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/43409iBF80CABD02B9B399/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Chram_2-1736443588920.png" alt="Chram_2-1736443588920.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Only flowfiles with merge_priority = 1 will be successfully routed, while the flowfiles with merge_priority = 2 are stuck in "Wait". Files with merge_priority = 2 to arrive at the EnforceOrder processor before the flowfiles with merge_priority = 1. To my understanding, the flowfiles should be re-processed as soon as a file with the current merge_priority has been processed?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 17:29:42 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Flowfile-stuck-in-Wait-in-EnforceOrder-processor/m-p/399894#M250566</guid>
      <dc:creator>Chram</dc:creator>
      <dc:date>2025-01-09T17:29:42Z</dc:date>
    </item>
    <item>
      <title>Re: Flowfile stuck in Wait in EnforceOrder processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Flowfile-stuck-in-Wait-in-EnforceOrder-processor/m-p/399900#M250569</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/123162"&gt;@Chram&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Lets backup and first understand the use case you are trying to solve here.&lt;BR /&gt;&lt;BR /&gt;From the look of your dataflows it appears you have two FlowFiles that you want to merge via the MergeContent processor.&amp;nbsp; The order in which they are merged is important to you.&amp;nbsp; This sounds like a use case better solved by using the "Defragment" merge strategy in the MergeContent processor rather then trying to use EnforceOrder processor.&lt;BR /&gt;&lt;BR /&gt;Is there more to your use case which necessitates the use of enforceOrder?&lt;BR /&gt;&lt;BR /&gt;As far as your dataflow goes,&amp;nbsp; I am having trouble reproducing the issue you described.&lt;BR /&gt;I see my priority 2 file sitting in wait only until my matching priority 1 file arrives.&amp;nbsp;&lt;BR /&gt;The dataflow screenshot you shared also does not show a wait relationship being routed anywhere.&amp;nbsp; Are you using the "retry" + "terminate" checkboxes on the wait relationship instead?&amp;nbsp; If so, what are the retry settings configured?&lt;BR /&gt;&lt;BR /&gt;Rather then use "retry" on the wait relationship, try dragging a new connection away from and back to the EnforceOrder processor to create a loop and assign the "Wait" relationship to that looped connection (make sure to also uncheck "retry" on the wait relationship).&amp;nbsp; &amp;nbsp;Does same issue still persist?&lt;/P&gt;&lt;P&gt;Please help our community thrive. If you found&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;any&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;of the suggestions/solutions provided helped you with solving your issue or answering your question, please take a moment to login and click "&lt;SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;Accept as Solution&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;" on&amp;nbsp;&lt;STRONG&gt;one or more&lt;/STRONG&gt;&amp;nbsp;of them that helped.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you,&lt;BR /&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 19:14:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Flowfile-stuck-in-Wait-in-EnforceOrder-processor/m-p/399900#M250569</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2025-01-09T19:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Flowfile stuck in Wait in EnforceOrder processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Flowfile-stuck-in-Wait-in-EnforceOrder-processor/m-p/399902#M250570</link>
      <description>&lt;P&gt;Hi Matt,&lt;BR /&gt;thanks for your your answer.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;wrote:&lt;P&gt;From the look of your dataflows it appears you have two FlowFiles that you want to merge via the MergeContent processor.&amp;nbsp; The order in which they are merged is important to you.&amp;nbsp; This sounds like a use case better solved by using the "Defragment" merge strategy in the MergeContent processor rather then trying to use EnforceOrder processor.&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Sorry for not mentioning this. My workflow starts with a series of API calls to obtain data, that is converted into xml fragments. With the merge processor, I am trying to merge those xml fragments into one final XML file. Hence the order is important.&lt;BR /&gt;The files can have different product_id attributes and I only want to merge files with the same product id. Therefore I am using the MergeProcessor with the Bin-Packing Algorithm. As far as I know (I just started using Nifi last month) it is not possible to control the order using this algorithm?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;wrote:&lt;P&gt;As far as your dataflow goes,&amp;nbsp; I am having trouble reproducing the issue you described.&lt;BR /&gt;I see my priority 2 file sitting in wait only until my matching priority 1 file arrives.&amp;nbsp;&lt;BR /&gt;The dataflow screenshot you shared also does not show a wait relationship being routed anywhere.&amp;nbsp; Are you using the "retry" + "terminate" checkboxes on the wait relationship instead?&amp;nbsp; If so, what are the retry settings configured?&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;BR /&gt;I hadn't configured the wait relationship yet. I was under the impression, the EnforceOrder processor would re-visit flowfiles in "wait" status once other priority 1 files have been processed.&lt;BR /&gt;&lt;BR /&gt;I routed the wait relationship to a RouteOnAttribute processor (is there another way?) which then routes back to EnforceOrder:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Chram_0-1736457213768.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/43411i5627EAFF78A47044/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Chram_0-1736457213768.png" alt="Chram_0-1736457213768.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;The priority 2 file will now be processed, but the order, in which the files are merged, seems to be random. Sometimes its the correct order, sometimes its not.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 21:20:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Flowfile-stuck-in-Wait-in-EnforceOrder-processor/m-p/399902#M250570</guid>
      <dc:creator>Chram</dc:creator>
      <dc:date>2025-01-09T21:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Flowfile stuck in Wait in EnforceOrder processor</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Flowfile-stuck-in-Wait-in-EnforceOrder-processor/m-p/399932#M250573</link>
      <description>&lt;P&gt;I changed my config to this:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Chram_0-1736502865061.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/43422i966B1E327BD5BB64/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Chram_0-1736502865061.png" alt="Chram_0-1736502865061.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Chram_1-1736503020379.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/43423i03BB05A7C5B348F7/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Chram_1-1736503020379.png" alt="Chram_1-1736503020379.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Chram_2-1736503056565.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/43424i782D4297091C6009/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Chram_2-1736503056565.png" alt="Chram_2-1736503056565.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;This seems to do the trick.&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 09:58:10 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Flowfile-stuck-in-Wait-in-EnforceOrder-processor/m-p/399932#M250573</guid>
      <dc:creator>Chram</dc:creator>
      <dc:date>2025-01-10T09:58:10Z</dc:date>
    </item>
  </channel>
</rss>

