Skip to main content

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 NameAPI NameDefault ValueAllowable ValuesDescription
Maximum Batch Size *max-batch-size1Maximum 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

NameDescription
originalThe FlowFiles that were used to create the package are sent to this relationship
successThe packaged FlowFile is sent to this relationship

Reads Attributes

This processor does not read attributes.

Writes Attributes

NameDescription
mime.typeThe 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
    1. "Maximum Batch Size" > 1 can help improve performance by batching many flowfiles together into 1 larger file that is transmitted by InvokeHTTP.
    2. Connect the success relationship of PackageFlowFile to the input of InvokeHTTP.
  • InvokeHTTP
    1. "HTTP Method" = "POST" to send data to ListenHTTP.
    2. "HTTP URL" should include the hostname, port, and path to the ListenHTTP.
    3. "Request Content-Type" = "${mime.type}" because PackageFlowFile output files have attribute mime.type=application/flowfile-v3.
  • ListenHTTP
    1. "Listening Port" = a unique port number.
    2. ListenHTTP automatically unpacks files that have attribute mime.type=application/flowfile-v3.
    3. 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
    1. "Maximum Batch Size" > 1 can improve storage efficiency by batching many FlowFiles together into 1 larger file that is stored.
    2. Connect the success relationship to the input of any NiFi egress processor for offline storage.
  • UnpackContent
    1. "Packaging Format" = "application/flowfile-v3".
    2. Connect the output of a NiFi ingress processor that reads files stored offline to the input of UnpackContent.
    3. 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.

See Also

MergeContent, UnpackContent