<?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: Does any one know why or under what circumstances NIFI passes a null flowfile to a custom NIFI processor ? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-any-one-know-why-or-under-what-circumstances-NIFI/m-p/207063#M59817</link>
    <description>&lt;P&gt;It's Java, if you aren't expecting nulls.  Expect crashes.&lt;/P&gt;&lt;P&gt;First Rule of Java, Handle Nulls.&lt;/P&gt;&lt;P&gt;Second Rule of Java, Handle Exceptions because you forgot 1st rule.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Mar 2018 20:40:09 GMT</pubDate>
    <dc:creator>TimothySpann</dc:creator>
    <dc:date>2018-03-20T20:40:09Z</dc:date>
    <item>
      <title>Does any one know why or under what circumstances NIFI passes a null flowfile to a custom NIFI processor ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-any-one-know-why-or-under-what-circumstances-NIFI/m-p/207060#M59814</link>
      <description>&lt;P&gt;Does any one know why or under what circumstances NIFI passes a null flowfile to a custom NIFI processor ? We are seeing cases where the session that is passed in as an input to the onTrigger method of the custom (java) processor contains a session with a null flow file.      Is this a normal condition ?  We are treating it as an error case and logging it as an error.  (Not sure if this is the correct thing to do.&lt;/P&gt;&lt;P&gt;The following code inside of the custom processor's "onTrigger" method is returning a null flow file.&lt;/P&gt;&lt;P&gt;FlowFile flowFile = session.get();&lt;/P&gt;&lt;P&gt;
if (flowFile == null) {&lt;/P&gt;&lt;P&gt;       getLogger().error("End Invocation - Failure " + className + "Instance HashCode: " + hashCode + " onTrigger operation.  Got null flowflile from session " + sessionHashCode +" and returning control to NIFI at " + System.currentTimeMillis());
return;&lt;/P&gt;&lt;P&gt;
}&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 03:49:30 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-any-one-know-why-or-under-what-circumstances-NIFI/m-p/207060#M59814</guid>
      <dc:creator>mark_berman</dc:creator>
      <dc:date>2017-04-21T03:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Does any one know why or under what circumstances NIFI passes a null flowfile to a custom NIFI processor ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-any-one-know-why-or-under-what-circumstances-NIFI/m-p/207061#M59815</link>
      <description>&lt;P&gt;This is normal behavior, typically you just call session.get() and if the flow file returned is null then just return from the processor:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFile.java#L181-L184" target="_blank"&gt;https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/PutFile.java#L181-L184&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The most common reason for this is when concurrent tasks is set to more than 1 for a processor with an input queue. In this case, the framework might trigger both threads to execute, but thread 1 might grab the only flow file, or all the available flow files, and by the time thread 2 executes there is nothing left.&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2017 04:16:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-any-one-know-why-or-under-what-circumstances-NIFI/m-p/207061#M59815</guid>
      <dc:creator>bbende</dc:creator>
      <dc:date>2017-04-21T04:16:08Z</dc:date>
    </item>
    <item>
      <title>Re: Does any one know why or under what circumstances NIFI passes a null flowfile to a custom NIFI processor ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-any-one-know-why-or-under-what-circumstances-NIFI/m-p/207062#M59816</link>
      <description>&lt;P&gt;I got the same "issue" and that is exactly the case for multiple threads.&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mark&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 20:29:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-any-one-know-why-or-under-what-circumstances-NIFI/m-p/207062#M59816</guid>
      <dc:creator>mark_lin</dc:creator>
      <dc:date>2018-03-20T20:29:27Z</dc:date>
    </item>
    <item>
      <title>Re: Does any one know why or under what circumstances NIFI passes a null flowfile to a custom NIFI processor ?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-any-one-know-why-or-under-what-circumstances-NIFI/m-p/207063#M59817</link>
      <description>&lt;P&gt;It's Java, if you aren't expecting nulls.  Expect crashes.&lt;/P&gt;&lt;P&gt;First Rule of Java, Handle Nulls.&lt;/P&gt;&lt;P&gt;Second Rule of Java, Handle Exceptions because you forgot 1st rule.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Mar 2018 20:40:09 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Does-any-one-know-why-or-under-what-circumstances-NIFI/m-p/207063#M59817</guid>
      <dc:creator>TimothySpann</dc:creator>
      <dc:date>2018-03-20T20:40:09Z</dc:date>
    </item>
  </channel>
</rss>

