From fc01e0ccf4ce33e58883d3421d7f12ed2fbc90bd Mon Sep 17 00:00:00 2001 From: Jim Steinebrey Date: Fri, 7 Jun 2024 15:38:52 -0400 Subject: [PATCH] NIFI-13198 Updated RouteText to skip writing to auto-terminated relationships This closes #8939 Signed-off-by: David Handermann --- .../java/org/apache/nifi/processors/standard/RouteText.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteText.java b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteText.java index df2f885202..f48253b758 100644 --- a/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteText.java +++ b/nifi-extension-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/RouteText.java @@ -517,7 +517,8 @@ public class RouteText extends AbstractProcessor { relationship = REL_NO_MATCH; } - if (relationship != null) { + // If the target relationship (usually REL_NO_MATCH) is auto-terminated, don't bother creating the flowfile or writing to it. + if (relationship != null && !context.isAutoTerminated(relationship)) { final Group group = getGroup(matchLine, groupPattern); appendLine(session, flowFileMap, relationship, originalFlowFile, line, charset, group); }