<?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: Ensure RunMongoAggregation runs after PutMongo in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ensure-RunMongoAggregation-runs-after-PutMongo/m-p/231878#M82724</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/93179/adnanachowdhury.html" nodeid="93179" target="_blank"&gt;@Adnan
 Chowdhury
&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;Instead of PutMongo processor you can &lt;STRONG&gt;use PutMongoRecord processor&lt;/STRONG&gt; and you don't need to split the json objects.&lt;/P&gt;&lt;P&gt;By using PutMongoRecord processor your flow looks some thing like below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="85741-flow.png" style="width: 1532px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/14903i29A7FCE4F9319351/image-size/medium?v=v2&amp;amp;px=400" role="button" title="85741-flow.png" alt="85741-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Configure the &lt;STRONG&gt;PutMongoRecord&lt;/STRONG&gt; processor RecordReader controller service as &lt;STRONG&gt;CsvReader &lt;/STRONG&gt;then processor will reads and put the json objects in MongoDatabase.&lt;/P&gt;&lt;P&gt;Then you can run RunMongoAggregation processor to run the aggregation.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(or)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;With your existing flow:&lt;/STRONG&gt;&lt;BR /&gt;Use &lt;STRONG&gt;Merge Content processor&lt;/STRONG&gt; after PutMOngo processor and configure the &lt;STRONG&gt;merge Content processor Merge Strategy as Defragment &lt;/STRONG&gt;then this processor merges all the splitted json objects into one file.&lt;/P&gt;&lt;P&gt;Then use Merged relationship from MergeCOntent processor to trigger RunMongoAggregation.&lt;/P&gt;&lt;P&gt;By using this way we are going to wait until all the fragments are merged into one file then only we are triggering RunMongoAggregation Processor.&lt;BR /&gt;&lt;STRONG&gt;&lt;U&gt;Flow:&lt;/U&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="85743-flow.png" style="width: 1975px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/14904i87D1F676991746C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="85743-flow.png" alt="85743-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Refer to &lt;A href="https://community.hortonworks.com/questions/64337/apache-nifi-merge-content.html" target="_blank" rel="nofollow noopener noreferrer"&gt;this&lt;/A&gt; link for MergeContent configurations.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;If the Answer helped to resolve your issue, &lt;STRONG&gt;Click on Accept button below to accept the answer,&lt;/STRONG&gt; That would be great help to Community users to find solution quickly for these kind of issues.&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 00:33:16 GMT</pubDate>
    <dc:creator>Shu_ashu</dc:creator>
    <dc:date>2019-08-18T00:33:16Z</dc:date>
    <item>
      <title>Ensure RunMongoAggregation runs after PutMongo</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ensure-RunMongoAggregation-runs-after-PutMongo/m-p/231877#M82723</link>
      <description>&lt;P&gt;For my NiFi data flow, I am taking CSV, converting them into JSON, posting those JSON files into a database (PutMongo), and then running an aggregation function (RunMongoAggregation). Attached are images to show that data file. My question is how can I construct my flow so that I can ensure that RunMongoAggregation is hit after PutMongo? I've looked into implementing some Wait/Notify pattern but got really lost in the implementation. Ideally, I would like to have a RunMongoAggregation triggered whenever new data gets into the PutMongo processor. &lt;/P&gt;&lt;P&gt;If anyone would like to test the processor, I have attached the template file. It is tested with AIS ship data (find online)&lt;/P&gt;
&lt;BR /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6123i37257DFCCA07B9C0/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="putmongo.jpg" title="putmongo.jpg" /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6125iC1644969D1B96197/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="runmongoaggregation.jpg" title="runmongoaggregation.jpg" /&gt;</description>
      <pubDate>Mon, 27 Aug 2018 19:15:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ensure-RunMongoAggregation-runs-after-PutMongo/m-p/231877#M82723</guid>
      <dc:creator>Adnan_A_Chowdhu</dc:creator>
      <dc:date>2018-08-27T19:15:49Z</dc:date>
    </item>
    <item>
      <title>Re: Ensure RunMongoAggregation runs after PutMongo</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ensure-RunMongoAggregation-runs-after-PutMongo/m-p/231878#M82724</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/93179/adnanachowdhury.html" nodeid="93179" target="_blank"&gt;@Adnan
 Chowdhury
&lt;/A&gt;
&lt;/P&gt;&lt;P&gt;Instead of PutMongo processor you can &lt;STRONG&gt;use PutMongoRecord processor&lt;/STRONG&gt; and you don't need to split the json objects.&lt;/P&gt;&lt;P&gt;By using PutMongoRecord processor your flow looks some thing like below&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="85741-flow.png" style="width: 1532px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/14903i29A7FCE4F9319351/image-size/medium?v=v2&amp;amp;px=400" role="button" title="85741-flow.png" alt="85741-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Configure the &lt;STRONG&gt;PutMongoRecord&lt;/STRONG&gt; processor RecordReader controller service as &lt;STRONG&gt;CsvReader &lt;/STRONG&gt;then processor will reads and put the json objects in MongoDatabase.&lt;/P&gt;&lt;P&gt;Then you can run RunMongoAggregation processor to run the aggregation.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;(or)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;With your existing flow:&lt;/STRONG&gt;&lt;BR /&gt;Use &lt;STRONG&gt;Merge Content processor&lt;/STRONG&gt; after PutMOngo processor and configure the &lt;STRONG&gt;merge Content processor Merge Strategy as Defragment &lt;/STRONG&gt;then this processor merges all the splitted json objects into one file.&lt;/P&gt;&lt;P&gt;Then use Merged relationship from MergeCOntent processor to trigger RunMongoAggregation.&lt;/P&gt;&lt;P&gt;By using this way we are going to wait until all the fragments are merged into one file then only we are triggering RunMongoAggregation Processor.&lt;BR /&gt;&lt;STRONG&gt;&lt;U&gt;Flow:&lt;/U&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="85743-flow.png" style="width: 1975px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/14904i87D1F676991746C5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="85743-flow.png" alt="85743-flow.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Refer to &lt;A href="https://community.hortonworks.com/questions/64337/apache-nifi-merge-content.html" target="_blank" rel="nofollow noopener noreferrer"&gt;this&lt;/A&gt; link for MergeContent configurations.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;If the Answer helped to resolve your issue, &lt;STRONG&gt;Click on Accept button below to accept the answer,&lt;/STRONG&gt; That would be great help to Community users to find solution quickly for these kind of issues.&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 00:33:16 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ensure-RunMongoAggregation-runs-after-PutMongo/m-p/231878#M82724</guid>
      <dc:creator>Shu_ashu</dc:creator>
      <dc:date>2019-08-18T00:33:16Z</dc:date>
    </item>
    <item>
      <title>Re: Ensure RunMongoAggregation runs after PutMongo</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ensure-RunMongoAggregation-runs-after-PutMongo/m-p/231879#M82725</link>
      <description>&lt;P&gt;Thank you Shu for your quick response. I followed your instructions regarding the PutMongoRecord processor. That helped simplify my flow a bit.&lt;/P&gt;&lt;P&gt;If the RunMongoAggregation is working as I think it is, then as a FlowFile runs through the processor, it will "trigger" the processor and then route onto original, while the aggregation works on the database and output into "results" (see image below). Is that your thought process? Also -- I probably have to clear out the database I'm aggregating on between data-sets to prevent duplicates, do I not? &lt;A rel="user" href="https://community.cloudera.com/users/18929/yaswanthmuppireddy.html" nodeid="18929"&gt;@Shu&lt;/A&gt;&lt;/P&gt;
&lt;BR /&gt;&lt;IMG src="https://community.cloudera.com/t5/image/serverpage/image-id/6328i9CDC0FBDA2955FE1/image-size/large?v=1.0&amp;amp;px=999" border="0" alt="aggregation-trigger.png" title="aggregation-trigger.png" /&gt;</description>
      <pubDate>Tue, 28 Aug 2018 22:17:22 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Ensure-RunMongoAggregation-runs-after-PutMongo/m-p/231879#M82725</guid>
      <dc:creator>Adnan_A_Chowdhu</dc:creator>
      <dc:date>2018-08-28T22:17:22Z</dc:date>
    </item>
  </channel>
</rss>

