1-1 Read Files from Directory, Write to MarkLogic
This example watches a directory for files, imports them into MarkLogic, then deletes them. The MarkLogic URI is /files/ followed by the filename. The NiFi filename property is set by the GetFile processor.
Many NiFi properties support embedded expressions, such as ${filename} in the ml.uri property below. For more about expressions, see Apache NiFi Expression Language Guide.
Screencast (old, using InvokeHTTP instead of PutMarkLogic)
Processors:
-
GetFile – reads files from a watched directory
-
Properties
- Input Directory: /some/path
-
Properties
-
PutMarkLogic
-
Properties
- DatabaseClient Service: (your MarkLogic DatabaseClient Service)
- URI Attribute Name: filename
- URI Prefix: /files/
-
Settings
- Automatically Terminate Relationships: failure and success
-
Properties
![](../images/01-001 read files flow.png)