EnforceOrder 2.0.0

Bundle
org.apache.nifi | nifi-standard-nar
Description
Enforces expected ordering of FlowFiles that belong to the same data group within a single node. Although PriorityAttributePrioritizer can be used on a connection to ensure that flow files going through that connection are in priority order, depending on error-handling, branching, and other flow designs, it is possible for FlowFiles to get out-of-order. EnforceOrder can be used to enforce original ordering for those FlowFiles. [IMPORTANT] In order to take effect of EnforceOrder, FirstInFirstOutPrioritizer should be used at EVERY downstream relationship UNTIL the order of FlowFiles physically get FIXED by operation such as MergeContent or being stored to the final destination.
Tags
order, sort
Input Requirement
REQUIRED
Supports Sensitive Dynamic Properties
false
Properties
State Management
Scopes Description
LOCAL EnforceOrder uses following states per ordering group: '<groupId>.target' is a order number which is being waited to arrive next. When a FlowFile with a matching order arrives, or a FlowFile overtakes the FlowFile being waited for because of wait timeout, target order will be updated to (FlowFile.order + 1). '<groupId>.max is the maximum order number for a group. '<groupId>.updatedAt' is a timestamp when the order of a group was updated last time. These managed states will be removed automatically once a group is determined as inactive, see 'Inactive Timeout' for detail.
Relationships
Name Description
wait A FlowFile with non matching order will be routed to this relationship
skipped A FlowFile that has an order younger than current, which means arrived too late and skipped, will be routed to this relationship.
success A FlowFile with a matching order number will be routed to this relationship.
failure A FlowFiles which does not have required attributes, or fails to compute those will be routed to this relationship
overtook A FlowFile that waited for preceding FlowFiles longer than Wait Timeout and overtook those FlowFiles, will be routed to this relationship.
Writes Attributes
Name Description
EnforceOrder.startedAt All FlowFiles going through this processor will have this attribute. This value is used to determine wait timeout.
EnforceOrder.result All FlowFiles going through this processor will have this attribute denoting which relationship it was routed to.
EnforceOrder.detail FlowFiles routed to 'failure' or 'skipped' relationship will have this attribute describing details.
EnforceOrder.expectedOrder FlowFiles routed to 'wait' or 'skipped' relationship will have this attribute denoting expected order when the FlowFile was processed.