<?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>topic Handle exception and store the invalid record in mongoDB. in Talend Studio</title>
    <link>https://community.qlik.com/t5/Talend-Studio/Handle-exception-and-store-the-invalid-record-in-mongoDB/m-p/2340286#M108330</link>
    <description>&lt;P&gt;I'm extracting the data from MongoDB and then doing some processing on that in tJavaRow. After that I'm storing it into MySQL DB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My requirement is that if any record is invalid/corrupt &amp;amp; exception occurs (while processing data or while storing in DB) then this record should not load to MySQL db.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;For example , &lt;/B&gt;&lt;/P&gt;&lt;P&gt;When the job is started , it load 50 records from MongoDB. Let's say the 37th record have some missing field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Current Behaviour :&lt;/B&gt;&lt;/P&gt;&lt;P&gt;So currently NullPointerException is being thrown when I'm trying to process data in tJavaRow &amp;amp; the job is being terminated immediately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Expected Behaviour :&lt;/B&gt;&lt;/P&gt;&lt;P&gt;My job should skip the 37th record (that have problem) and store other 49 records in MySQL DB.&lt;/P&gt;&lt;P&gt;The 37th record should be printed (using tLogRow) or stored in MongoDB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;My findings :&lt;/B&gt;&lt;/P&gt;&lt;P&gt;I have tried tLogCatcher but there is two problems in this.When it throws exception &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;It is showing the error message (Which is fine). But it isn't printing the complete (37th) record which loaded from mongoDB.&lt;/LI&gt;&lt;LI&gt;Then the job is terminated and NO record is being saved to MySQL.&lt;/LI&gt;&lt;/UL&gt;</description>
    <pubDate>Fri, 15 Nov 2024 22:14:16 GMT</pubDate>
    <dc:creator>raowaqasakram</dc:creator>
    <dc:date>2024-11-15T22:14:16Z</dc:date>
    <item>
      <title>Handle exception and store the invalid record in mongoDB.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handle-exception-and-store-the-invalid-record-in-mongoDB/m-p/2340286#M108330</link>
      <description>&lt;P&gt;I'm extracting the data from MongoDB and then doing some processing on that in tJavaRow. After that I'm storing it into MySQL DB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My requirement is that if any record is invalid/corrupt &amp;amp; exception occurs (while processing data or while storing in DB) then this record should not load to MySQL db.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;For example , &lt;/B&gt;&lt;/P&gt;&lt;P&gt;When the job is started , it load 50 records from MongoDB. Let's say the 37th record have some missing field.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Current Behaviour :&lt;/B&gt;&lt;/P&gt;&lt;P&gt;So currently NullPointerException is being thrown when I'm trying to process data in tJavaRow &amp;amp; the job is being terminated immediately.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;Expected Behaviour :&lt;/B&gt;&lt;/P&gt;&lt;P&gt;My job should skip the 37th record (that have problem) and store other 49 records in MySQL DB.&lt;/P&gt;&lt;P&gt;The 37th record should be printed (using tLogRow) or stored in MongoDB.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;My findings :&lt;/B&gt;&lt;/P&gt;&lt;P&gt;I have tried tLogCatcher but there is two problems in this.When it throws exception &lt;/P&gt;&lt;UL&gt;&lt;LI&gt;It is showing the error message (Which is fine). But it isn't printing the complete (37th) record which loaded from mongoDB.&lt;/LI&gt;&lt;LI&gt;Then the job is terminated and NO record is being saved to MySQL.&lt;/LI&gt;&lt;/UL&gt;</description>
      <pubDate>Fri, 15 Nov 2024 22:14:16 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handle-exception-and-store-the-invalid-record-in-mongoDB/m-p/2340286#M108330</guid>
      <dc:creator>raowaqasakram</dc:creator>
      <dc:date>2024-11-15T22:14:16Z</dc:date>
    </item>
    <item>
      <title>Re: Handle exception and store the invalid record in mongoDB.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handle-exception-and-store-the-invalid-record-in-mongoDB/m-p/2340287#M108331</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;Go to the tip of the day &lt;A href="https://community.talend.com/s/tips" alt="https://community.talend.com/s/tips" target="_blank"&gt;page&lt;/A&gt;, and read the tip of Step 27, 2022. This tip shows how to catch the exception and continue to process next record, output the invalid data to a file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Shong&lt;/P&gt;</description>
      <pubDate>Wed, 28 Dec 2022 03:33:23 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handle-exception-and-store-the-invalid-record-in-mongoDB/m-p/2340287#M108331</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-12-28T03:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: Handle exception and store the invalid record in mongoDB.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handle-exception-and-store-the-invalid-record-in-mongoDB/m-p/2340288#M108332</link>
      <description>&lt;P&gt;Hi @Shicong Hong​&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have read this. But It didn't worked for my scenario.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My job design looks like&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;&amp;nbsp;Design&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;B&gt;tMongoDbInput --&amp;gt; tJavaRow --&amp;gt; tMap --&amp;gt; tDbOutput.&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As per your tip , you have used tJavaFlex &amp;amp; I'm using tJavaRow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to use all the instructions/code of tJavaRow in try-catch block in tJavaRow.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is catching the exception and also printing for the buggy/invalid record but it is not "rejecting" that record .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;B&gt;For example ,&lt;/B&gt; the 37th record have some NullPointerExcep. Thus this is showing NullPointer and then using the value from previous line and sending the 37th record to tMap.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly suggest a way to do this which is compatible to my design.&lt;/P&gt;&lt;P&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 30 Dec 2022 16:24:52 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handle-exception-and-store-the-invalid-record-in-mongoDB/m-p/2340288#M108332</guid>
      <dc:creator>raowaqasakram</dc:creator>
      <dc:date>2022-12-30T16:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Handle exception and store the invalid record in mongoDB.</title>
      <link>https://community.qlik.com/t5/Talend-Studio/Handle-exception-and-store-the-invalid-record-in-mongoDB/m-p/2340289#M108333</link>
      <description>&lt;P&gt;Hi  &lt;/P&gt;&lt;P&gt;You should use tJavaFlex instead of tJavaRow, the job looks like:&lt;/P&gt;&lt;P&gt;tMongoDBInput--main-tFlowToIterate--iterate--tJavaFlex--iterate--tFixedFlowInput1--tMap--tDBoutput&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what's the problem with this design?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Jan 2023 03:08:26 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Talend-Studio/Handle-exception-and-store-the-invalid-record-in-mongoDB/m-p/2340289#M108333</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-03T03:08:26Z</dc:date>
    </item>
  </channel>
</rss>

