<?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: How to retrieve a complete list of flowfiles in a specific queue in NiFi using the API or UI in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/How-to-retrieve-a-complete-list-of-flowfiles-in-a-specific/m-p/378482#M243552</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/99493"&gt;@samrathal&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Apache NiFi has hardcoded return size to 100:&lt;BR /&gt;&lt;A href="https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectionDAO.java#L361" target="_blank"&gt;https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectionDAO.java#L361&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am sure this was originally done for performance and NiFi JVM heap usage reasons.&lt;BR /&gt;&lt;SPAN&gt;The first 100 returned should be the oldest 100 in queue (keeping in mind that a connection will also show count of FlowFiles pending processing by downstream processor and count of those currently allocated to a downstream component process.&amp;nbsp; The listing only returns those pending FlowFiles and not those already owned by downstream component).&lt;/SPAN&gt;&lt;SPAN&gt;What is the use case for needing to list more?&amp;nbsp; Ideally what is found in a queue should be changing rapidly, so expectation is that each listing request would be different.&amp;nbsp;Listing a queue does not stop NiFi processing.&amp;nbsp; The intent is not for NiFi to ever hold FlowFiles in any connection.&amp;nbsp;&amp;nbsp; So using API to&amp;nbsp; poll connection for FlowFile listings seems odd to me.&amp;nbsp; What is returned by that listing could be inaccurate milliseconds later.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Also be careful with your API requests.&amp;nbsp; When a listing is performed through the browser three different request are made.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. First listing-request is made and replicated to all nodes to get result sets.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;2. Return from step 1 request gives the ID for the generated listing request being held in heap memory.&amp;nbsp; That ID is used to fetch the results in that specific listing ID&lt;BR /&gt;3. A DELETE request is made to remove the listing with that ID from NiFi.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*** When using API, If steps 1 and 2 are all that are being executed, the various listing request(s) will stay in heap memory.&lt;/SPAN&gt;&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, 02 Nov 2023 16:50:08 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2023-11-02T16:50:08Z</dc:date>
    <item>
      <title>How to retrieve a complete list of flowfiles in a specific queue in NiFi using the API or UI</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-retrieve-a-complete-list-of-flowfiles-in-a-specific/m-p/377843#M243355</link>
      <description>&lt;P&gt;I need to retrieve all flowfiles in a specific queue in NiFi, but the API only returns up to 100 results at a time. My queue contains 358 flowfiles, so I need a way to retrieve all of them&lt;/P&gt;&lt;P&gt;Below are the API am using for get the flowfiles.&lt;/P&gt;&lt;P&gt;API :&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://myserver.com:myport/nifi-api/flowfile-queues/ba619122-3c65-3279-a2ba-b3ad89f8a429/listing-requests/903d485f-d4aa-102a-0000-0112e4a15ea" rel="nofollow noreferrer" target="_blank"&gt;https://myserver.com:myport/nifi-api/flowfile-queues/ba619122-3c65-3279-a2ba-b3ad89f8a429/listing-requests/903d485f-d4aa-102a-0000-0112e4a15ea&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;{&lt;BR /&gt;"listingRequest": {&lt;BR /&gt;"id": "903d485f-d4aa-102a-0000-0112e4a15ea",&lt;BR /&gt;"uri": "&lt;A href="https://myserver.com:myport/nifi-api/flowfile-queues/ba619122-3c65-3279-a2ba-b3ad89f8a429/listing-requests/903d485f-d4aa-102a-0000-0112e4a15ea" target="_blank"&gt;https://myserver.com:myport/nifi-api/flowfile-queues/ba619122-3c65-3279-a2ba-b3ad89f8a429/listing-requests/903d485f-d4aa-102a-0000-0112e4a15ea&lt;/A&gt;",&lt;BR /&gt;"submissionTime": "10/18/2023 17:07:57.632 IST",&lt;BR /&gt;"lastUpdated": "17:07:57 IST",&lt;BR /&gt;"percentCompleted": 1,&lt;BR /&gt;"finished": true,&lt;BR /&gt;"maxResults": 100,&lt;BR /&gt;"state": "Completed successfully",&lt;BR /&gt;"queueSize": {&lt;BR /&gt;"byteCount": 3792,&lt;BR /&gt;"objectCount": 350&lt;BR /&gt;},&lt;BR /&gt;"flowFileSummaries": [&lt;BR /&gt;{&lt;BR /&gt;"HERE IS THE FLOW FILES TILL 100TH POSITIONS": 100&lt;BR /&gt;}&lt;BR /&gt;]&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Wed, 18 Oct 2023 13:06:00 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-retrieve-a-complete-list-of-flowfiles-in-a-specific/m-p/377843#M243355</guid>
      <dc:creator>samrathal</dc:creator>
      <dc:date>2023-10-18T13:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to retrieve a complete list of flowfiles in a specific queue in NiFi using the API or UI</title>
      <link>https://community.cloudera.com/t5/Support-Questions/How-to-retrieve-a-complete-list-of-flowfiles-in-a-specific/m-p/378482#M243552</link>
      <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/99493"&gt;@samrathal&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Apache NiFi has hardcoded return size to 100:&lt;BR /&gt;&lt;A href="https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectionDAO.java#L361" target="_blank"&gt;https://github.com/apache/nifi/blob/main/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardConnectionDAO.java#L361&lt;/A&gt;&lt;/P&gt;&lt;P&gt;I am sure this was originally done for performance and NiFi JVM heap usage reasons.&lt;BR /&gt;&lt;SPAN&gt;The first 100 returned should be the oldest 100 in queue (keeping in mind that a connection will also show count of FlowFiles pending processing by downstream processor and count of those currently allocated to a downstream component process.&amp;nbsp; The listing only returns those pending FlowFiles and not those already owned by downstream component).&lt;/SPAN&gt;&lt;SPAN&gt;What is the use case for needing to list more?&amp;nbsp; Ideally what is found in a queue should be changing rapidly, so expectation is that each listing request would be different.&amp;nbsp;Listing a queue does not stop NiFi processing.&amp;nbsp; The intent is not for NiFi to ever hold FlowFiles in any connection.&amp;nbsp;&amp;nbsp; So using API to&amp;nbsp; poll connection for FlowFile listings seems odd to me.&amp;nbsp; What is returned by that listing could be inaccurate milliseconds later.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Also be careful with your API requests.&amp;nbsp; When a listing is performed through the browser three different request are made.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1. First listing-request is made and replicated to all nodes to get result sets.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;2. Return from step 1 request gives the ID for the generated listing request being held in heap memory.&amp;nbsp; That ID is used to fetch the results in that specific listing ID&lt;BR /&gt;3. A DELETE request is made to remove the listing with that ID from NiFi.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;*** When using API, If steps 1 and 2 are all that are being executed, the various listing request(s) will stay in heap memory.&lt;/SPAN&gt;&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, 02 Nov 2023 16:50:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/How-to-retrieve-a-complete-list-of-flowfiles-in-a-specific/m-p/378482#M243552</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2023-11-02T16:50:08Z</dc:date>
    </item>
  </channel>
</rss>

