Wait 2025.10.2.19

捆绑包

org.apache.nifi | nifi-standard-nar

描述

Routes incoming FlowFiles to the 'wait' relationship until a matching release signal is stored in the distributed cache from a corresponding Notify processor. When a matching release signal is identified, a waiting FlowFile is routed to the 'success' relationship. The release signal entry is then removed from the cache. The attributes of the FlowFile that produced the release signal are copied to the waiting FlowFile if the Attribute Cache Regex property of the corresponding Notify processor is set properly. If there are multiple release signals in the cache identified by the Release Signal Identifier, and the Notify processor is configured to copy the FlowFile attributes to the cache, then the FlowFile passing the Wait processor receives the union of the attributes of the FlowFiles that produced the release signals in the cache (identified by Release Signal Identifier). Waiting FlowFiles will be routed to 'expired' if they exceed the Expiration Duration. If you need to wait for more than one signal, specify the desired number of signals via the 'Target Signal Count' property. This is particularly useful with processors that split a source FlowFile into multiple fragments, such as SplitText. In order to wait for all fragments to be processed, connect the 'original' relationship to a Wait processor, and the 'splits' relationship to a corresponding Notify processor. Configure the Notify and Wait processors to use the '${fragment.identifier}' as the value of 'Release Signal Identifier', and specify '${fragment.count}' as the value of 'Target Signal Count' in the Wait processor. It is recommended to use a prioritizer (for instance First In First Out) when using the 'wait' relationship as a loop.

标签

cache、distributed、hold、map、release、signal、wait

输入要求

REQUIRED

支持敏感的动态属性

false

属性

属性

描述

attribute-copy-mode

指定如何处理从进入 Notify 处理器的 FlowFiles 复制的属性

distributed-cache-service

用于从对应的 Notify 处理器检查释放信号的控制器服务。

expiration-duration

表示等待持续时间过后 FlowFiles 将会路由到“expired”关系

releasable-flowfile-count

一个值或属性表达式语言语句的结果,将根据 FlowFile 进行评估,以确定可释放的 FlowFile 数量。这指定定在目标计数达到目标信号计数时可以释放多少个 FlowFiles。零 (0) 具有特殊含义,表示只要信号数量达到目标,就可以释放任意数量的 FlowFiles。

release-signal-id

一个指定特定释放信号缓存的键值。要决定是否应将 Wait 处理器正在处理的 FlowFile 发送到“success”还是“wait”关系,处理器会检查该键指定的缓存中的信号。

signal-counter-name

在缓存中(由释放信号标识符指定),信号可能属于不同的计数器。如果指定了此属性,则处理器将检查缓存中属于该特定计数器的信号数量。如果未指定,则处理器检查缓存中的信号总数。

target-signal-count

缓存中需要达到的信号数量(由释放信号标识符指定),以便将由 Wait 处理器处理的 FlowFile 发送到“success”关系。如果缓存中的信号数量达到此数值,FlowFile 则将路由到“success”关系,并且缓存中的信号数量将减少该值。如果指定了信号计数器名称,则该处理器检查特定的计数器,否则将检查缓存中的信号总数。

wait-buffer-count

指定可用于检查是否能继续处理的最大传入 FlowFiles 数量。缓冲越大,性能越好,因为它通过信号标识符对 FlowFiles 进行分组,从而减少与缓存服务的交互次数。每次处理器执行时只能处理一个信号标识符。

wait-mode

指定如何处理等待通知信号的 FlowFile

wait-penalty-duration

如果配置了此属性,则当某个信号标识符已处理但未满足释放条件时,该标识符会被惩罚。并且在指定时间内,拥有该标识符的 FlowFiles 将不会再次被处理,因此该信号标识符不会阻塞其他标识符的处理。这对于如下场景非常有用:Wait 处理器需要处理多个信号标识符,每个标识符有多个 FlowFiles,且每个标识符内 FlowFiles 的释放顺序很重要。FlowFile 的顺序可通过优先级器进行配置。IMPORTANT:有待处理信号队列数量的限制,Wait 处理器可能无法检查所有队列中的信号标识符。有关最佳实践,请参阅更多详细信息。

关系

名称

描述

expired

超过配置的过期持续时间的 FlowFile 将路由到此关系。

failure

当无法到达缓存,或者释放信号标识符的计算结果为 null 或空时,FlowFiles 将路由到此关系

success

在缓存中找到了匹配释放信号的 FlowFile 将路由到此关系。

wait

在缓存中未找到匹配释放信号的 FlowFile 将路由到此关系。

写入属性

名称

描述

wait.start.timestamp

所有 FlowFiles 文件都将具有“wait.start.timestamp”属性,其值为首次进入该处理器时的纪元时间戳。 这用于判断 FlowFile 是否过期。 当 FlowFile 传输到 failure、expired 或 success 时不会写入此属性。

wait.counter.<counterName>

自上次缓存为空以来,至少出现过一个信号的每个计数器名称,都会作为属性复制到当前的 FlowFile 中。

另请参阅

语言: 中文