从多个相同的流文件中仅转发一个流文件

Forward only one flowfile from multiple same flowfiles

我有多个流文件作为 spitjson 处理器的输出,都是具有相同内容的相同流文件。我只想转发一个流文件。有没有办法在 nifi

是的,应该可以。

splitjson 处理器将 fragment.index 属性写入每个流文件

A one-up number that indicates the ordering of the split FlowFiles that were created from a single parent FlowFile

每个流文件将收到一个唯一的 fragment.index1 到流文件的数量

因此您可以使用属性上的路由来仅 fragment.index 等于 1

的 keeper flowfile

流量:

输入数据:

[{"name":"Gayle Hays"},{"name":"Merritt Calhoun"},{"name":"Tamara Lane"},{"name":"Contreras Heath"},{"name":"Martinez Watson"}]

RouteOnAttribute处理器配置:

文档:https://nifi.apache.org/docs/nifi-docs/components/org.apache.nifi/nifi-standard-nar/1.12.1/org.apache.nifi.processors.standard.SplitJson/index.html