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); }