PackageFlowFile
Description
This processor will package FlowFile attributes and content into an output FlowFile that can be exported from NiFi and imported back into NiFi, preserving the original attributes and content.
Tags
attributes, flowfile, flowfile-stream, flowfile-stream-v3, package
Properties
In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
Display Name | API Name | Default Value | Allowable Values | Description |
---|---|---|---|---|
Maximum Batch Size * | max-batch-size | 1 | Maximum number of FlowFiles to package into one output FlowFile using a best effort, non guaranteed approach. Multiple input queues can produce unexpected batching behavior. |
Dynamic Properties
This component does not support dynamic properties.
Relationships
Name | Description |
---|---|
original | The FlowFiles that were used to create the package are sent to this relationship |
success | The packaged FlowFile is sent to this relationship |
Reads Attributes
This processor does not read attributes.
Writes Attributes
Name | Description |
---|---|
mime.type | The mime.type will be changed to application/flowfile-v3 |
State Management
This component does not store state.
Restricted
This component is not restricted.
Input Requirement
This component requires an incoming relationship.
Example Use Cases Involving Other Components
Multiprocessor Use Case 1
Send FlowFile content and attributes from one NiFi instance to another NiFi instance.
A Remote Process Group is preferred to send FlowFiles between two NiFi instances, but an alternative is to use PackageFlowFile then InvokeHTTP sending to ListenHTTP.
Components Involved
- PackageFlowFile
- "Maximum Batch Size" > 1 can help improve performance by batching many flowfiles together into 1 larger file that is transmitted by InvokeHTTP.
- Connect the success relationship of PackageFlowFile to the input of InvokeHTTP.
- InvokeHTTP
- "HTTP Method" = "POST" to send data to ListenHTTP.
- "HTTP URL" should include the hostname, port, and path to the ListenHTTP.
- "Request Content-Type" = "${mime.type}" because PackageFlowFile output files have attribute mime.type=application/flowfile-v3.
- ListenHTTP
- "Listening Port" = a unique port number.
- ListenHTTP automatically unpacks files that have attribute mime.type=application/flowfile-v3.
- If PackageFlowFile batches 99 FlowFiles into 1 file that InvokeHTTP sends, then the original 99 FlowFiles will be output by ListenHTTP.
Multiprocessor Use Case 2
Export FlowFile content and attributes from NiFi to external storage and reimport.
Components Involved
- PackageFlowFile
- "Maximum Batch Size" > 1 can improve storage efficiency by batching many FlowFiles together into 1 larger file that is stored.
- Connect the success relationship to the input of any NiFi egress processor for offline storage.
- UnpackContent
- "Packaging Format" = "application/flowfile-v3".
- Connect the output of a NiFi ingress processor that reads files stored offline to the input of UnpackContent.
- If PackageFlowFile batches 99 FlowFiles into 1 file that is read from storage, then the original 99 FlowFiles will be output by UnpackContent.
System Resource Considerations
This component does not specify system resource considerations.