How to excluded the full json file content while make a InvokeHTPP on Nifi?

29 views Asked by At

I am making a flowfile which is getting the data from a public API then I splits the data in order to have one record for each message then convert each message to CSV then update the filename by giving a UUID. Then I am putting the file on my local disk.

The flowfile work but I am getting in my local disk directory the file containing all the messages (data) and I do not want to get this file but just the unique file with one message per file.

How do I exclude the original file containing all the data ?

I am supposed to get 100 file in my repository after the execution of a flowfile but I am gettin 101 (including the file which I don't want).

enter image description here

I tried using RouteAttribute processor without success.

1

There are 1 answers

2
steven-matison On BEST ANSWER

@Nolan

Few things to unpack here:

  1. Split, then convert is anti pattern. Investigate RecordReader based processors. You can do split/convery in a single processor.
  2. Do not use wait, unless you have thoroughly tested and understood how it works.
  3. As Datawranger and Daggett suggest, do not route all relationships to your downstream processor. Only the correct, success relationship should be pointed downstream. During testing, I always route all relationships to an output port to evaluate those results as needed in flow developement.

The final answer, delete your multi route line from SplitJson to ConvertRecord. Remake a single new line for splits. Auto terminate original. Route failure to output port during testing. Investigate alternative routes for failure (or auto terminate) once you have flow working.