<?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: Getting API token once during a NIFI flow in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Getting-API-token-once-during-a-NIFI-flow/m-p/315907#M226626</link>
    <description>&lt;P&gt;&lt;a href="https://community.cloudera.com/t5/user/viewprofilepage/user-id/87446"&gt;@AnkushKoul&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You may consider having two dataflows here because you would need to store this password somewhere that your putSFTP processor dataflow would need have access to.&lt;BR /&gt;One dataflow that acquires the password from the rest endpoint and another that is actually performs your putSFTP.&lt;BR /&gt;&lt;BR /&gt;Flow to get password would consist of a GenerateFlowFile (configure to generate a FlowFIle on each NiFi node using a run schedule to control how often password will be refreshed)--&amp;gt; invoketHTTP --&amp;gt; putDistributedMapCache (Configured to use DistributedMapCacheClient that uses "localhost" as server hostname. Will need to also add a DistributedMapCacheServer Controller service that above client will talk to.&amp;nbsp; This will make sure each node grabs password and stores it locally on that nodes's DMCServer)&lt;BR /&gt;&lt;BR /&gt;Then in your flow using putSFTP, you would replace the invokeHTTP processor a fetchDistributedMapCache processor just before the putSftp processor (suggest looping failure relationship from putSFTP back to fetchDistributedMapCache processor&amp;nbsp; just in case password changes or there was no password stored when fetch was attempted first time).&lt;BR /&gt;&lt;BR /&gt;Keep in mind that flows like this are not idea.&amp;nbsp; The retrieved password that you are placing in to a FlowFile attribute is stored in plaintext.&lt;BR /&gt;&lt;BR /&gt;If you found this solution helpful, please take a moment to login and click accept on this solution.&lt;BR /&gt;Good luck,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;</description>
    <pubDate>Wed, 05 May 2021 13:10:39 GMT</pubDate>
    <dc:creator>MattWho</dc:creator>
    <dc:date>2021-05-05T13:10:39Z</dc:date>
  </channel>
</rss>

