Write Failed Documents to Disk
You cannot start a processor until all of its relationships are connected to other processors, or are auto-terminated. So far, this example has not connected or auto-terminated the "failed" relationship for each of the processors. This section describes how to route "failed" FlowFiles to a processor that will write the documents to disk in IDX, XML, or JSON format.
To write failed documents to disk
-
Add an idol.nifi > WriteDocument processor to the canvas.
- Create a connection from each of the processors to the WriteDocument processor. Hover the mouse over a processor (such as KeyViewExtractFiles or KeyViewFilterDocument) until you see the connection icon -
- and then drag the icon to the WriteDocument processor. When the Create Connection dialog box opens, look for the For Relationships area and select the failure check box. Then repeat this for your other processors.
-
Right-click the WriteDocument processor and click Configure.
The Configure Processor dialog box opens.
- Click the Properties tab.
-
Set the following properties:
IDOL License Service The name of your IDOL License Service. Format The format in which to write the document (for example IDX or XML). File in which to write the document The path of the file to write the documents to. This could be a path to a shared folder. Archive Directory The path in which files are archived when they exceed the maximum size. Max file size in bytes before archiving The maximum size a file can reach before being archived. - Click the Relationships tab.
- In this example, there is nothing to do after writing the failed documents, so select the terminate check box for each relationship (failure, original, and written).
-
Click Apply.
The pipeline should now look similar to the example described in the introduction.