0

I have a requirement where in I want to do some preprocessing and postprocessing for each processor. Basically I want to add start time end time and some extra details on each flowfile So what will be the best way.

  1. Create custom controller service
  2. add execute script before after each processor

Or any other way?

Bryan Bende
  • 18,320
  • 1
  • 28
  • 39
happy
  • 2,550
  • 17
  • 64
  • 109
  • Can you give more information about what you want to achieve? If you just want to get some general idea how long a flowfile took through the flow, maybe some UpdateAttribute Processors using NiFi Expression Language is enough? – Christoph Bauer Apr 05 '19 at 10:49
  • @ChristophBauer Once the whole flow is completed I want to know all the processors ids/names through which the given flow file passed and for each processor what was the start time and end time. This is for debugging purpose and also append exception if occured. – happy Apr 05 '19 at 10:56
  • 3
    A lot of this information is already available in provenance, although its not guaranteed that every processor produces a provenance event – Bryan Bende Apr 05 '19 at 14:15
  • @BryanBende how can I extend SiteToSiteProvenanceReportingTask.java to add some more details. I have created custom controller service. shoukd I just copy this class in StandardMyService?. Any tutorial link pls? – happy Apr 07 '19 at 08:41
  • Yes copying it into your own NAR would probably be best, StandardMyService is for a controller service but this is a reporting task, I don't think we have an archetype of reporting tasks but you could probably take the processor archetype and just add a reporting task to it, you'll need to add a new service loader file in META-INF/services – Bryan Bende Apr 08 '19 at 13:57
  • @BryanBende I was able to use the existing nar coding and add some fields.Now I am able to fetch contentclaim metadata through ProvenanceEventRecord class . How can I read the content of flow file. The one which I get when clicked on view button on ui. – happy Apr 09 '19 at 09:01

0 Answers0