<?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 Store timestamp to use it in next GetHTTP call in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-timestamp-to-use-it-in-next-GetHTTP-call/m-p/218579#M79339</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using Nifi to pull GPS data from a server using http request. &lt;/P&gt;&lt;P&gt;The request has a parameter "T", allowing the user to get the GPS reports made since "T".&lt;/P&gt;&lt;P&gt;The response give a list of GPS reports, followed by the timestamp of the last report made.&lt;/P&gt;&lt;P&gt;I want to be able to save the timestamp returned by the last request, in order to use it for my next request.&lt;/P&gt;&lt;P&gt;To
 be ultra clear : when I launch my NiFi flow, I want to use "T=0" in my 
request (which return me the last reports for all cars), then use the 
timestamp returned to execute the next request (to get only the ones
which made a report since the last call), and so on.&lt;/P&gt;&lt;P&gt;Is there an elegent way to do that?&lt;/P&gt;&lt;P&gt;Thx a lot.&lt;/P&gt;</description>
    <pubDate>Fri, 08 Jun 2018 15:46:12 GMT</pubDate>
    <dc:creator>pierric_ruchier</dc:creator>
    <dc:date>2018-06-08T15:46:12Z</dc:date>
    <item>
      <title>Store timestamp to use it in next GetHTTP call</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-timestamp-to-use-it-in-next-GetHTTP-call/m-p/218579#M79339</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I'm using Nifi to pull GPS data from a server using http request. &lt;/P&gt;&lt;P&gt;The request has a parameter "T", allowing the user to get the GPS reports made since "T".&lt;/P&gt;&lt;P&gt;The response give a list of GPS reports, followed by the timestamp of the last report made.&lt;/P&gt;&lt;P&gt;I want to be able to save the timestamp returned by the last request, in order to use it for my next request.&lt;/P&gt;&lt;P&gt;To
 be ultra clear : when I launch my NiFi flow, I want to use "T=0" in my 
request (which return me the last reports for all cars), then use the 
timestamp returned to execute the next request (to get only the ones
which made a report since the last call), and so on.&lt;/P&gt;&lt;P&gt;Is there an elegent way to do that?&lt;/P&gt;&lt;P&gt;Thx a lot.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 15:46:12 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-timestamp-to-use-it-in-next-GetHTTP-call/m-p/218579#M79339</guid>
      <dc:creator>pierric_ruchier</dc:creator>
      <dc:date>2018-06-08T15:46:12Z</dc:date>
    </item>
    <item>
      <title>Re: Store timestamp to use it in next GetHTTP call</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-timestamp-to-use-it-in-next-GetHTTP-call/m-p/218580#M79340</link>
      <description>&lt;A rel="user" href="https://community.cloudera.com/users/81302/pierricruchier.html" nodeid="81302"&gt;@Pierric Ruchier&lt;/A&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;My initial thought would be to use the PutDistributedMapCache and FetchDistributedMapCache processors.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;You would nee to setup a flow that uses a GenerateFlowFile and PutDistributedMapCache processors to created the initial cache entry with a value of "0".&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;Then in your main flow,  Generate a FlowFile (how ever you want to routinely trigger main flow) --&amp;gt; FetchDistributedMapCache  (retrieve current cached value)  --&amp;gt; make request based on cached value retrieved --&amp;gt; PutDistributedMapCache (update stored cached value with new timestamp) --&amp;gt; rest of flow...&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;This gives you a way to constantly update a value in cache that can be used.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Matt&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;When an "Answer" addresses/solves your question, please select "Accept" beneath that answer.  This encourages user participation in this forum.&lt;/P&gt;</description>
      <pubDate>Fri, 08 Jun 2018 22:52:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-timestamp-to-use-it-in-next-GetHTTP-call/m-p/218580#M79340</guid>
      <dc:creator>MattWho</dc:creator>
      <dc:date>2018-06-08T22:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: Store timestamp to use it in next GetHTTP call</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-timestamp-to-use-it-in-next-GetHTTP-call/m-p/218581#M79341</link>
      <description>&lt;P&gt;Thanks a lot, I'll try this solution and will report whether it's working or not after testing it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jun 2018 15:43:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-timestamp-to-use-it-in-next-GetHTTP-call/m-p/218581#M79341</guid>
      <dc:creator>pierric_ruchier</dc:creator>
      <dc:date>2018-06-11T15:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Store timestamp to use it in next GetHTTP call</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-timestamp-to-use-it-in-next-GetHTTP-call/m-p/218582#M79342</link>
      <description>&lt;P&gt;Ok, for the record :&lt;/P&gt;&lt;P&gt;I've tried your solution and it's working, but I found a simpler solution : I changed my "GetHTTP" processor for a "InvokeHTTP" processor, which allows input FlowFile. Then I've linked the response of my request back to the "InvokeHTTP", which allows me to trigger my request when the previous request is done, instead of triggering it with a "GenerateFlowFile" processor.&lt;/P&gt;&lt;P&gt;Thanks a lot ! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Jun 2018 21:24:59 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Store-timestamp-to-use-it-in-next-GetHTTP-call/m-p/218582#M79342</guid>
      <dc:creator>pierric_ruchier</dc:creator>
      <dc:date>2018-06-12T21:24:59Z</dc:date>
    </item>
  </channel>
</rss>

