<?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: NiFi - Trigger a Processor once after the Queue gets empty for the previous processor. in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Trigger-a-Processor-once-after-the-Queue-gets-empty-for/m-p/382326#M244551</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/103587"&gt;@glad1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;No not necessary.&amp;nbsp; I suggested becasue i was still unclear how often your initial ExecuteSQL was producing a source file.&amp;nbsp; The PG makes it easy to throttle per source FLowFile processing so you would get one merged FlowFile for each produced FlowFile.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Matt&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2024 14:37:13 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2024-01-17T14:37:13Z</dc:date>
    <item>
      <title>NiFi - Trigger a Processor once after the Queue gets empty for the previous processor.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Trigger-a-Processor-once-after-the-Queue-gets-empty-for/m-p/381801#M244416</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="glad1_0-1704801946227.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39353i4AE33CE8F7521CB3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="glad1_0-1704801946227.png" alt="glad1_0-1704801946227.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;As seen from the image above. My requirement is for the "ExecuteSQL" processor to run &lt;STRONG&gt;only once&lt;/STRONG&gt; after all the queued files are processed via "PutDatabaseRecord" processor.&lt;BR /&gt;&lt;BR /&gt;Right now it will run 190+57 times but I want to run after all the queued files are processed through. Is there any way to do this in Nifi ?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 12:13:55 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Trigger-a-Processor-once-after-the-Queue-gets-empty-for/m-p/381801#M244416</guid>
      <dc:creator>glad1</dc:creator>
      <dc:date>2024-01-09T12:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi - Trigger a Processor once after the Queue gets empty for the previous processor.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Trigger-a-Processor-once-after-the-Queue-gets-empty-for/m-p/381802#M244417</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/103587"&gt;@glad1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The first question is how do you know when all the FlowFiles have been processed through the PutDatabaseRecord processor?&amp;nbsp; Here I see FlowFiles queued in every connection.&amp;nbsp; So before you can tackle your question, need to understand more about your complete dataflow.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;1. How does the flow of data begin?&amp;nbsp;&lt;BR /&gt;2. Does it come in as one FlowFile that is split?&amp;nbsp;&lt;BR /&gt;3. Does it come in batches?&amp;nbsp; How do you know when a complete batch is ingested?&lt;BR /&gt;4. Is ingestion based on cron?&lt;BR /&gt;5. Does the ExecuteSQL use content of FlowFile Attributes from the incoming FlowFiles when it is executed?&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;SPAN&gt;Matt&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 13:47:17 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Trigger-a-Processor-once-after-the-Queue-gets-empty-for/m-p/381802#M244417</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2024-01-09T13:47:17Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi - Trigger a Processor once after the Queue gets empty for the previous processor.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Trigger-a-Processor-once-after-the-Queue-gets-empty-for/m-p/381814#M244422</link>
      <description>&lt;P&gt;1&amp;amp;2) It comes from a single flowfile, which is then split using splitjson&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="glad1_0-1704814339041.png" style="width: 400px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39358i18AE40D1C1B0EE0A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="glad1_0-1704814339041.png" alt="glad1_0-1704814339041.png" /&gt;&lt;/span&gt;&lt;BR /&gt;&lt;SPAN&gt;3&amp;amp;4) no&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;5) No, it doesnt.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2024 15:36:18 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Trigger-a-Processor-once-after-the-Queue-gets-empty-for/m-p/381814#M244422</guid>
      <dc:creator>glad1</dc:creator>
      <dc:date>2024-01-09T15:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi - Trigger a Processor once after the Queue gets empty for the previous processor.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Trigger-a-Processor-once-after-the-Queue-gets-empty-for/m-p/382041#M244470</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/103587"&gt;@glad1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Based on what you shared, you may be able to accomplish what you are trying to do using a couple additional processors and a Child Process Group that utilizes "&lt;SPAN&gt;Process Group FlowFile Concurrency" settings.&lt;BR /&gt;&lt;BR /&gt;So your use case involves:&lt;BR /&gt;For each 1 FlowFile output by your ExecuteSQLRecord processor you want to do ALL the following before the next FlowFile produced by ExecuteSQL record is processed:&lt;BR /&gt;1. Split the FlowFIle into X number of FlowFiles using SplitJson.&lt;BR /&gt;2. Modify each one of the produced Split FlowFiles using UpdateRecord.&lt;BR /&gt;3. Write all those modified FlowFiles ot another Database using PutDatabaseRecord&lt;BR /&gt;4. ExecuteSQL only once to update Record that all splits were processed.&lt;BR /&gt;&lt;BR /&gt;Then repeat above for next produce FlowFile&lt;BR /&gt;&lt;BR /&gt;If this is correct, here is what you might want to try:&lt;BR /&gt;1. create a Process Group that you will insert in teh middle of this flow as shown in the following image:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_0-1705006915117.png" style="width: 693px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39396i104AD8E41BF230BC/image-dimensions/693x415?v=v2" width="693" height="415" role="button" title="MattWho_0-1705006915117.png" alt="MattWho_0-1705006915117.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;2. Configure that Process group as follows:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_1-1705006982170.png" style="width: 549px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39397iA06C65E40D5D28B2/image-dimensions/549x1082?v=v2" width="549" height="1082" role="button" title="MattWho_1-1705006982170.png" alt="MattWho_1-1705006982170.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Important properties to set here are:&lt;BR /&gt;-&amp;nbsp;&lt;SPAN&gt;Process Group FlowFile Concurrency = Single FlowFile Per Node&lt;BR /&gt;- Process Group Outbound Policy = Batch Output&lt;BR /&gt;What this does is allow only one FlowFile (per node in multi-node NiFi) to enter this PG at any given time. Inside this Process group you will have handle the processing of this FlowFile (split, update, putDB).&amp;nbsp; The outbound policy will not release any of the Produced Splits from teh PG until all are queued at the output port.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="MattWho_2-1705007226621.png" style="width: 710px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/39398i06070BF2AB9285BA/image-dimensions/710x369?v=v2" width="710" height="369" role="button" title="MattWho_2-1705007226621.png" alt="MattWho_2-1705007226621.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;You'll notice I added one additional optional processor &lt;A href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.24.0/org.apache.nifi.processors.standard.ModifyBytes/index.html" target="_self"&gt;ModifyBytes&lt;/A&gt; to your dataflow (configured with "Remove all Content = true).&amp;nbsp; This will zero out the content on the FlowFiles after they were written using the PutDatabaseRecord processor.&amp;nbsp; Then those FlowFiles with no content now are sent to connection feeding output port where they are held until all splits produced are queued.&amp;nbsp; They will then all be released at once from the PG to the next new processor&amp;nbsp;&lt;A class="component-link" href="https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.24.0/org.apache.nifi.processors.standard.MergeContent/index.html" target="_self"&gt;MergeContent&lt;/A&gt;. The MergeContent processor will merge all those FlowFiles into a single FlowFile that feeds your ExecuteSQL (UpdateRecordStatus toP) processor.&amp;nbsp; Now you have a single notification for the original FlowFile that was split and processed.&amp;nbsp; Additionally you have created separation between each source FlowFile processed at start of dataflow.&lt;/P&gt;&lt;P&gt;If you found any of the suggestions/solutions provided helped you with your issue, 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 one or more 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, 11 Jan 2024 21:16:52 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Trigger-a-Processor-once-after-the-Queue-gets-empty-for/m-p/382041#M244470</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2024-01-11T21:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi - Trigger a Processor once after the Queue gets empty for the previous processor.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Trigger-a-Processor-once-after-the-Queue-gets-empty-for/m-p/382322#M244549</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/35454"&gt;@MattWho&lt;/a&gt;&amp;nbsp;.&lt;BR /&gt;&lt;BR /&gt;Adding MergeContent in the end with defragmentation as the strategy helps.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have one question, Is the PG necessary ?,&amp;nbsp; if all I get is 1 flowfile output from the starting&amp;nbsp;&lt;SPAN&gt;ExecuteSQLRecord&amp;nbsp;processor per day ?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 12:44:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Trigger-a-Processor-once-after-the-Queue-gets-empty-for/m-p/382322#M244549</guid>
      <dc:creator>glad1</dc:creator>
      <dc:date>2024-01-17T12:44:36Z</dc:date>
    </item>
    <item>
      <title>Re: NiFi - Trigger a Processor once after the Queue gets empty for the previous processor.</title>
      <link>https://community.cloudera.com/t5/Support-Questions/NiFi-Trigger-a-Processor-once-after-the-Queue-gets-empty-for/m-p/382326#M244551</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/103587"&gt;@glad1&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;No not necessary.&amp;nbsp; I suggested becasue i was still unclear how often your initial ExecuteSQL was producing a source file.&amp;nbsp; The PG makes it easy to throttle per source FLowFile processing so you would get one merged FlowFile for each produced FlowFile.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Matt&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2024 14:37:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/NiFi-Trigger-a-Processor-once-after-the-Queue-gets-empty-for/m-p/382326#M244551</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2024-01-17T14:37:13Z</dc:date>
    </item>
  </channel>
</rss>

