You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by jo...@apache.org on 2022/04/20 14:55:03 UTC

[nifi] branch support/nifi-1.16 updated (927f31129a -> 04a309af17)

This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a change to branch support/nifi-1.16
in repository https://gitbox.apache.org/repos/asf/nifi.git


    from 927f31129a NIFI-9868 fix version references to 1.16.1-SNAP after all cherry-picks
     new eea044612a NIFI-9925 Adjust PutUDP and SNMP tests to run without preferring IPv4
     new e4d8cd99d2 NIFI-9939 Upgraded SSHJ from 0.32.0 to 0.33.0
     new 75105eab22 NIFI-9917 fix the tooltip of "delivery guarantee/best effort" to a more accurate one
     new 04a309af17 NIFI-9776 Adding the possibility to export flow definition with referenced services (#5859)

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 nifi-docs/src/main/asciidoc/user-guide.adoc        |  6 +-
 .../org/apache/nifi/web/NiFiServiceFacade.java     | 10 +++
 .../apache/nifi/web/StandardNiFiServiceFacade.java | 51 ++++++++++++++-
 .../apache/nifi/web/api/ProcessGroupResource.java  | 17 ++++-
 .../nifi/web/StandardNiFiServiceFacadeTest.java    | 64 +++++++++++++++++++
 .../nifi/web/api/TestProcessGroupResource.java     |  2 +-
 .../src/main/webapp/js/nf/canvas/nf-actions.js     | 18 +++++-
 .../main/webapp/js/nf/canvas/nf-context-menu.js    |  5 +-
 .../kafka/pubsub/PublishKafkaRecord_1_0.java       |  4 +-
 .../processors/kafka/pubsub/PublishKafka_1_0.java  |  4 +-
 .../kafka/pubsub/PublishKafkaRecord_2_0.java       |  4 +-
 .../processors/kafka/pubsub/PublishKafka_2_0.java  |  4 +-
 .../kafka/pubsub/PublishKafkaRecord_2_6.java       |  4 +-
 .../processors/kafka/pubsub/PublishKafka_2_6.java  |  4 +-
 .../snmp/factory/core/V1V2cSNMPFactoryTest.java    |  5 +-
 .../nifi/snmp/factory/core/V3SNMPFactoryTest.java  |  4 +-
 .../processors/standard/ssh/PatchedSFTPEngine.java | 72 ----------------------
 .../processors/standard/util/SFTPTransfer.java     |  4 +-
 .../nifi/processors/standard/TestPutUDP.java       |  9 ++-
 nifi-nar-bundles/nifi-standard-bundle/pom.xml      |  2 +-
 20 files changed, 188 insertions(+), 105 deletions(-)
 delete mode 100644 nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ssh/PatchedSFTPEngine.java


[nifi] 01/04: NIFI-9925 Adjust PutUDP and SNMP tests to run without preferring IPv4

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch support/nifi-1.16
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit eea044612a309b13961077d56d93f31b85d7cf9c
Author: Paul Grey <gr...@yahoo.com>
AuthorDate: Thu Apr 14 13:48:47 2022 -0400

    NIFI-9925 Adjust PutUDP and SNMP tests to run without preferring IPv4
    
    This closes #5976
    
    Signed-off-by: David Handermann <ex...@apache.org>
---
 .../org/apache/nifi/snmp/factory/core/V1V2cSNMPFactoryTest.java  | 5 ++++-
 .../org/apache/nifi/snmp/factory/core/V3SNMPFactoryTest.java     | 4 +++-
 .../java/org/apache/nifi/processors/standard/TestPutUDP.java     | 9 ++++-----
 3 files changed, 11 insertions(+), 7 deletions(-)

diff --git a/nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/test/java/org/apache/nifi/snmp/factory/core/V1V2cSNMPFactoryTest.java b/nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/test/java/org/apache/nifi/snmp/factory/core/V1V2cSNMPFactoryTest.java
index 7da6426ff9..80ef139582 100644
--- a/nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/test/java/org/apache/nifi/snmp/factory/core/V1V2cSNMPFactoryTest.java
+++ b/nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/test/java/org/apache/nifi/snmp/factory/core/V1V2cSNMPFactoryTest.java
@@ -25,10 +25,13 @@ import org.snmp4j.Snmp;
 import org.snmp4j.Target;
 import org.snmp4j.security.SecurityLevel;
 
+import java.util.regex.Pattern;
+
 import static org.apache.nifi.snmp.helper.configurations.SNMPConfigurationFactory.LOCALHOST;
 import static org.hamcrest.MatcherAssert.assertThat;
 import static org.hamcrest.core.IsInstanceOf.instanceOf;
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
 
@@ -62,7 +65,7 @@ public class V1V2cSNMPFactoryTest {
         final Snmp snmpManager = snmpFactory.createSnmpManagerInstance(snmpConfiguration);
 
         final String address = snmpManager.getMessageDispatcher().getTransportMappings().iterator().next().getListenAddress().toString();
-        assertEquals("0.0.0.0" + "/" + managerPort, address);
+        assertTrue(Pattern.compile("0.+?0/" + managerPort).matcher(address).matches());
     }
 
     @Test
diff --git a/nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/test/java/org/apache/nifi/snmp/factory/core/V3SNMPFactoryTest.java b/nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/test/java/org/apache/nifi/snmp/factory/core/V3SNMPFactoryTest.java
index e2c48dc0af..88cafe3fb5 100644
--- a/nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/test/java/org/apache/nifi/snmp/factory/core/V3SNMPFactoryTest.java
+++ b/nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/test/java/org/apache/nifi/snmp/factory/core/V3SNMPFactoryTest.java
@@ -28,6 +28,8 @@ import org.snmp4j.security.USM;
 import org.snmp4j.smi.Integer32;
 import org.snmp4j.smi.OctetString;
 
+import java.util.regex.Pattern;
+
 import static org.apache.nifi.snmp.helper.configurations.SNMPConfigurationFactory.LOCALHOST;
 import static org.apache.nifi.snmp.helper.configurations.SNMPV3ConfigurationFactory.AUTH_PASSPHRASE;
 import static org.apache.nifi.snmp.helper.configurations.SNMPV3ConfigurationFactory.AUTH_PROTOCOL;
@@ -73,7 +75,7 @@ public class V3SNMPFactoryTest {
 
         final String address = snmpManager.getMessageDispatcher().getTransportMappings().iterator().next().getListenAddress().toString();
         USM usm = (USM) SecurityModels.getInstance().getSecurityModel(new Integer32(3));
-        assertEquals("0.0.0.0" + "/" + managerPort, address);
+        assertTrue(Pattern.compile("0.+?0/" + managerPort).matcher(address).matches());
         assertTrue(usm.hasUser(null, new OctetString("SHAAES128")));
     }
 
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutUDP.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutUDP.java
index 104cec1989..bb8a1029cf 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutUDP.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestPutUDP.java
@@ -58,7 +58,7 @@ public class TestPutUDP {
     private final static char CONTENT_CHAR = 'x';
     private final static int DATA_WAIT_PERIOD = 50;
     private final static int DEFAULT_TEST_TIMEOUT_PERIOD = 10000;
-    private final static int LONG_TEST_TIMEOUT_PERIOD = 100000;
+    private final static int LONG_TEST_TIMEOUT_PERIOD = 30000;
 
     private TestRunner runner;
     private int port;
@@ -187,18 +187,17 @@ public class TestPutUDP {
         runner.assertValid();
     }
 
-    private void sendTestData(final String[] testData) throws InterruptedException {
+    private void sendTestData(final String[] testData) {
         sendTestData(testData, DEFAULT_ITERATIONS, DEFAULT_THREAD_COUNT);
     }
 
-    private void sendTestData(final String[] testData, final int iterations, final int threadCount) throws InterruptedException {
+    private void sendTestData(final String[] testData, final int iterations, final int threadCount) {
         for (String item : testData) {
             runner.setThreadCount(threadCount);
             for (int i = 0; i < iterations; i++) {
                 runner.enqueue(item.getBytes());
-                runner.run(1, false);
-                Thread.sleep(1);
             }
+            runner.run(iterations, false);
         }
 
         // ensure @OnStopped methods get called


[nifi] 02/04: NIFI-9939 Upgraded SSHJ from 0.32.0 to 0.33.0

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch support/nifi-1.16
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit e4d8cd99d295f4a7f91c3dcd8182d94a70520523
Author: exceptionfactory <ex...@apache.org>
AuthorDate: Wed Apr 20 07:59:20 2022 -0500

    NIFI-9939 Upgraded SSHJ from 0.32.0 to 0.33.0
    
    - Removed PatchedSFTPEngine with resolution of SFTP renaming in SSHJ 0.33.0
    
    Signed-off-by: Pierre Villard <pi...@gmail.com>
    
    This closes #5982.
---
 .../processors/standard/ssh/PatchedSFTPEngine.java | 72 ----------------------
 .../processors/standard/util/SFTPTransfer.java     |  4 +-
 nifi-nar-bundles/nifi-standard-bundle/pom.xml      |  2 +-
 3 files changed, 3 insertions(+), 75 deletions(-)

diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ssh/PatchedSFTPEngine.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ssh/PatchedSFTPEngine.java
deleted file mode 100644
index 1de696d504..0000000000
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/ssh/PatchedSFTPEngine.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.nifi.processors.standard.ssh;
-
-import net.schmizz.sshj.common.SSHException;
-import net.schmizz.sshj.connection.channel.direct.SessionFactory;
-import net.schmizz.sshj.sftp.PacketType;
-import net.schmizz.sshj.sftp.RenameFlags;
-import net.schmizz.sshj.sftp.Request;
-import net.schmizz.sshj.sftp.SFTPEngine;
-import net.schmizz.sshj.sftp.SFTPException;
-
-import java.io.IOException;
-import java.nio.charset.Charset;
-import java.util.Set;
-import java.util.concurrent.TimeUnit;
-
-/**
- * Patched SFTP Engine to workaround SFTP rename issue 751 in SSHJ 0.32.0
- *
- * This class can be removed once the issue is resolved in a future version of SSHJ
- */
-public class PatchedSFTPEngine extends SFTPEngine {
-
-    public PatchedSFTPEngine(final SessionFactory sessionFactory) throws SSHException {
-        super(sessionFactory);
-    }
-
-    /**
-     * Override rename request packet generation to workaround handling of rename flags
-     *
-     * @param oldPath Old path of file to be renamed
-     * @param newPath New path of file to be renamed
-     * @param flags Rename flags used for SFTP Version 5 or higher
-     * @throws IOException Thrown on unsupported protocol version or request processing failures
-     */
-    @Override
-    public void rename(final String oldPath, final String newPath, final Set<RenameFlags> flags) throws IOException {
-        if (operativeVersion < 1) {
-            throw new SFTPException("RENAME is not supported in SFTPv" + operativeVersion);
-        }
-
-        final Charset remoteCharset = sub.getRemoteCharset();
-        final Request request = newRequest(PacketType.RENAME)
-                .putString(oldPath, remoteCharset)
-                .putString(newPath, remoteCharset);
-        // SFTP Version 5 introduced rename flags according to Section 6.5 of the specification
-        if (operativeVersion >= 5) {
-            long renameFlagMask = 0L;
-            for (RenameFlags flag : flags) {
-                renameFlagMask = renameFlagMask | flag.longValue();
-            }
-            request.putUInt32(renameFlagMask);
-        }
-
-        request(request).retrieve(getTimeoutMs(), TimeUnit.MILLISECONDS).ensureStatusPacketIsOK();
-    }
-}
diff --git a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java
index 628b9825c7..2e58ee122d 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java
+++ b/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/SFTPTransfer.java
@@ -26,6 +26,7 @@ import net.schmizz.sshj.sftp.RemoteResourceFilter;
 import net.schmizz.sshj.sftp.RemoteResourceInfo;
 import net.schmizz.sshj.sftp.Response;
 import net.schmizz.sshj.sftp.SFTPClient;
+import net.schmizz.sshj.sftp.SFTPEngine;
 import net.schmizz.sshj.sftp.SFTPException;
 import net.schmizz.sshj.xfer.FilePermission;
 import net.schmizz.sshj.xfer.LocalSourceFile;
@@ -42,7 +43,6 @@ import org.apache.nifi.logging.ComponentLog;
 import org.apache.nifi.processor.ProcessSession;
 import org.apache.nifi.processor.exception.ProcessException;
 import org.apache.nifi.processor.util.StandardValidators;
-import org.apache.nifi.processors.standard.ssh.PatchedSFTPEngine;
 import org.apache.nifi.processors.standard.ssh.SSHClientProvider;
 import org.apache.nifi.processors.standard.ssh.StandardSSHClientProvider;
 import org.apache.nifi.proxy.ProxyConfiguration;
@@ -596,7 +596,7 @@ public class SFTPTransfer implements FileTransfer {
 
         final Map<String, String> attributes = flowFile == null ? Collections.emptyMap() : flowFile.getAttributes();
         this.sshClient = SSH_CLIENT_PROVIDER.getClient(ctx, attributes);
-        this.sftpClient = new SFTPClient(new PatchedSFTPEngine(sshClient).init());
+        this.sftpClient = new SFTPClient(new SFTPEngine(sshClient).init());
         this.closed = false;
 
         // Configure timeout for sftp operations
diff --git a/nifi-nar-bundles/nifi-standard-bundle/pom.xml b/nifi-nar-bundles/nifi-standard-bundle/pom.xml
index 07fc0c815c..d21d746f57 100644
--- a/nifi-nar-bundles/nifi-standard-bundle/pom.xml
+++ b/nifi-nar-bundles/nifi-standard-bundle/pom.xml
@@ -181,7 +181,7 @@
             <dependency>
                 <groupId>com.hierynomus</groupId>
                 <artifactId>sshj</artifactId>
-                <version>0.32.0</version>
+                <version>0.33.0</version>
             </dependency>
             <dependency>
                 <groupId>jakarta.activation</groupId>


[nifi] 04/04: NIFI-9776 Adding the possibility to export flow definition with referenced services (#5859)

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch support/nifi-1.16
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit 04a309af1763747ab9e832d7225df4c3fee0c0bd
Author: simonbence <61...@users.noreply.github.com>
AuthorDate: Wed Apr 20 16:29:38 2022 +0200

    NIFI-9776 Adding the possibility to export flow definition with referenced services (#5859)
    
    * NIFI-9776 Adding the possibility to export flow definition with referenced services
    
    * NIFI-9776 Refining naming based on code review
---
 nifi-docs/src/main/asciidoc/user-guide.adoc        |  6 +-
 .../org/apache/nifi/web/NiFiServiceFacade.java     | 10 ++++
 .../apache/nifi/web/StandardNiFiServiceFacade.java | 51 ++++++++++++++++-
 .../apache/nifi/web/api/ProcessGroupResource.java  | 17 +++++-
 .../nifi/web/StandardNiFiServiceFacadeTest.java    | 64 ++++++++++++++++++++++
 .../nifi/web/api/TestProcessGroupResource.java     |  2 +-
 .../src/main/webapp/js/nf/canvas/nf-actions.js     | 18 +++++-
 .../main/webapp/js/nf/canvas/nf-context-menu.js    |  5 +-
 8 files changed, 162 insertions(+), 11 deletions(-)

diff --git a/nifi-docs/src/main/asciidoc/user-guide.adoc b/nifi-docs/src/main/asciidoc/user-guide.adoc
index 3024878c2c..9b6286b40f 100644
--- a/nifi-docs/src/main/asciidoc/user-guide.adoc
+++ b/nifi-docs/src/main/asciidoc/user-guide.adoc
@@ -372,13 +372,15 @@ NOTE: It is also possible to double-click on the Process Group to enter it.
 - *View connections->Downstream*: This option allows the user to see and "jump to" downstream connections that are going out of the Process Group.
 - *Center in view*: This option centers the view of the canvas on the given Process Group.
 - *Group*: This option allows the user to create a new Process Group that contains the selected Process Group and any other components selected on the canvas.
-- *Download flow definition*: This option allows the user to download the flow definition of the process group as a JSON file. The file can be used as a backup or imported into a link:https://nifi.apache.org/registry.html[NiFi Registry^] using the <<toolkit-guide.adoc#nifi_CLI,NiFi CLI>>. (Note: If "Download flow definition" is selected for a versioned process group, there is no versioning information in the download. In other words, the resulting contents of the JSON file is the same wh [...]
+- *Download flow definition*: This option allows the user to download the flow definition of the process group as a JSON file. The file can be used as a backup or imported into a link:https://nifi.apache.org/registry.html[NiFi Registry^] using the <<toolkit-guide.adoc#nifi_CLI,NiFi CLI>>. There are two options when downloading a flow definition:
+** -> *Without external services*: Controller services referenced by the selected process group but outside its scope (e.g., services in a parent group) _will not be_ included in the flow definition as services.
+** -> *With external services*: Controller services referenced by the selected process group but outside its scope (e.g., services in a parent group) _will be_ included in the flow definition.
 - *Create template*: This option allows the user to create a template from the selected Process Group.
 - *Copy*: This option places a copy of the selected Process Group on the clipboard, so that it may be pasted elsewhere on the canvas by right-clicking on the canvas and selecting Paste. The Copy/Paste actions also may be done using the keystrokes Ctrl-C (Command-C) and Ctrl-V (Command-V).
 - *Empty all queues*: This option allows the user to empty all queues in the selected Process Group. All FlowFiles from all connections waiting at the time of the request will be removed.
 - *Delete*: This option allows the DFM to delete a Process Group.
 
-
+(Note: If "Download flow definition" is selected for a versioned process group, there is no versioning information in the download. In other words, the resulting contents of the JSON file is the same whether the process group is versioned or not.)
 
 [[remote_process_group]]
 image:iconRemoteProcessGroup.png["Remote Process Group", width=32]
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
index 1bbc4d9326..ea78af85ae 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/NiFiServiceFacade.java
@@ -1624,6 +1624,16 @@ public interface NiFiServiceFacade {
      */
     VersionedFlowSnapshot getCurrentFlowSnapshotByGroupId(String processGroupId);
 
+    /**
+     * Get the current state of the Process Group with the given ID, converted to a Versioned Flow Snapshot. Controller
+     * Services referenced by the Components contained by the Process Group but are part of the parent Process Group(s)
+     * will be included and will be considered as part of the requested Process Group.
+     *
+     * @param processGroupId the ID of the Process Group
+     * @return the current Process Group converted to a Versioned Flow Snapshot for download
+     */
+    VersionedFlowSnapshot getCurrentFlowSnapshotByGroupIdWithReferencedControllerServices(String processGroupId);
+
     /**
      * Returns the name of the Flow Registry that is registered with the given ID. If no Flow Registry exists with the given ID, will return
      * the ID itself as the name
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
index 066b1310f2..4cafa8429f 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/StandardNiFiServiceFacade.java
@@ -4682,6 +4682,23 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
 
     @Override
     public VersionedFlowSnapshot getCurrentFlowSnapshotByGroupId(final String processGroupId) {
+        return getCurrentFlowSnapshotByGroupId(processGroupId, false);
+    }
+
+    @Override
+    public VersionedFlowSnapshot getCurrentFlowSnapshotByGroupIdWithReferencedControllerServices(final String processGroupId) {
+        return getCurrentFlowSnapshotByGroupId(processGroupId, true);
+    }
+
+    private Set<String> getAllSubGroups(ProcessGroup processGroup) {
+        final Set<String> result = processGroup.findAllProcessGroups().stream()
+                .map(ProcessGroup::getIdentifier)
+                .collect(Collectors.toSet());
+        result.add(processGroup.getIdentifier());
+        return result;
+    }
+
+    private VersionedFlowSnapshot getCurrentFlowSnapshotByGroupId(final String processGroupId, final boolean includeReferencedControllerServices) {
         final ProcessGroup processGroup = processGroupDAO.getProcessGroup(processGroupId);
 
         // Create a complete (include descendant flows) VersionedProcessGroup snapshot of the flow as it is
@@ -4691,12 +4708,40 @@ public class StandardNiFiServiceFacade implements NiFiServiceFacade {
                 mapper.mapNonVersionedProcessGroup(processGroup, controllerFacade.getControllerServiceProvider());
 
         // Create a complete (include descendant flows) map of parameter contexts
-        final Map<String, VersionedParameterContext> parameterContexts =
-                mapper.mapParameterContexts(processGroup, true);
+        final Map<String, VersionedParameterContext> parameterContexts = mapper.mapParameterContexts(processGroup, true);
 
+        final Map<String, ExternalControllerServiceReference> externalControllerServiceReferences =
+                Optional.ofNullable(nonVersionedProcessGroup.getExternalControllerServiceReferences()).orElse(Collections.emptyMap());
+        final Set<VersionedControllerService> controllerServices = new HashSet<>(nonVersionedProcessGroup.getControllerServices());
         final VersionedFlowSnapshot nonVersionedFlowSnapshot = new VersionedFlowSnapshot();
+
+        ProcessGroup parentGroup = processGroup.getParent();
+
+        if (includeReferencedControllerServices && parentGroup != null) {
+            final Set<VersionedControllerService> externalServices = new HashSet<>();
+
+            do {
+                final Set<ControllerServiceNode> controllerServiceNodes = parentGroup.getControllerServices(false);
+
+                for (final ControllerServiceNode controllerServiceNode : controllerServiceNodes) {
+                    final VersionedControllerService versionedControllerService =
+                            mapper.mapControllerService(controllerServiceNode, controllerFacade.getControllerServiceProvider(), getAllSubGroups(processGroup), externalControllerServiceReferences);
+
+                    if (externalControllerServiceReferences.keySet().contains(versionedControllerService.getIdentifier())) {
+                        versionedControllerService.setGroupIdentifier(processGroupId);
+                        externalServices.add(versionedControllerService);
+                    }
+                }
+            } while ((parentGroup = parentGroup.getParent()) != null);
+
+            controllerServices.addAll(externalServices);
+            nonVersionedFlowSnapshot.setExternalControllerServices(new HashMap<>());
+        } else {
+            nonVersionedFlowSnapshot.setExternalControllerServices(externalControllerServiceReferences);
+        }
+
+        nonVersionedProcessGroup.setControllerServices(controllerServices);
         nonVersionedFlowSnapshot.setFlowContents(nonVersionedProcessGroup);
-        nonVersionedFlowSnapshot.setExternalControllerServices(nonVersionedProcessGroup.getExternalControllerServiceReferences());
         nonVersionedFlowSnapshot.setParameterContexts(parameterContexts);
         nonVersionedFlowSnapshot.setFlowEncodingVersion(RestBasedFlowRegistry.FLOW_ENCODING_VERSION);
 
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java
index 1c946c72ba..146631613f 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/ProcessGroupResource.java
@@ -349,7 +349,18 @@ public class ProcessGroupResource extends FlowUpdateResource<ProcessGroupImportE
         @ApiResponse(code = 404, message = "The specified resource could not be found."),
         @ApiResponse(code = 409, message = "The request was valid but NiFi was not in the appropriate state to process it. Retrying the same request later may be successful.")
     })
-    public Response exportProcessGroup(@ApiParam(value = "The process group id.", required = true) @PathParam("id") final String groupId) {
+    public Response exportProcessGroup(
+            @ApiParam(
+                    value = "The process group id.",
+                    required = true
+            )
+            @PathParam("id") final String groupId,
+            @ApiParam(
+                    value = "If referenced services from outside the target group should be included",
+                    required = false
+            )
+            @QueryParam("includeReferencedServices")
+            @DefaultValue("false") boolean includeReferencedServices) {
         // authorize access
         serviceFacade.authorizeAccess(lookup -> {
             // ensure access to process groups (nested), encapsulated controller services and referenced parameter contexts
@@ -359,7 +370,9 @@ public class ProcessGroupResource extends FlowUpdateResource<ProcessGroupImportE
         });
 
         // get the versioned flow
-        final VersionedFlowSnapshot currentVersionedFlowSnapshot = serviceFacade.getCurrentFlowSnapshotByGroupId(groupId);
+        final VersionedFlowSnapshot currentVersionedFlowSnapshot = includeReferencedServices
+            ? serviceFacade.getCurrentFlowSnapshotByGroupIdWithReferencedControllerServices(groupId)
+            : serviceFacade.getCurrentFlowSnapshotByGroupId(groupId);
 
         // determine the name of the attachment - possible issues with spaces in file names
         final VersionedProcessGroup currentVersionedProcessGroup = currentVersionedFlowSnapshot.getFlowContents();
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/StandardNiFiServiceFacadeTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/StandardNiFiServiceFacadeTest.java
index 87d80c1a24..50355e69ee 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/StandardNiFiServiceFacadeTest.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/StandardNiFiServiceFacadeTest.java
@@ -34,7 +34,9 @@ import org.apache.nifi.authorization.user.NiFiUserDetails;
 import org.apache.nifi.authorization.user.StandardNiFiUser.Builder;
 import org.apache.nifi.controller.FlowController;
 import org.apache.nifi.controller.flow.FlowManager;
+import org.apache.nifi.controller.service.ControllerServiceNode;
 import org.apache.nifi.controller.service.ControllerServiceProvider;
+import org.apache.nifi.flow.VersionedControllerService;
 import org.apache.nifi.groups.ProcessGroup;
 import org.apache.nifi.groups.RemoteProcessGroup;
 import org.apache.nifi.history.History;
@@ -71,10 +73,12 @@ import org.springframework.security.core.context.SecurityContextHolder;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Date;
+import java.util.HashMap;
 import java.util.HashSet;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.UUID;
 import java.util.stream.Collectors;
 
@@ -84,6 +88,7 @@ import static org.junit.Assert.assertNull;
 import static org.junit.Assert.assertTrue;
 import static org.junit.Assert.fail;
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.argThat;
 import static org.mockito.Mockito.anyInt;
 import static org.mockito.Mockito.mock;
@@ -91,6 +96,9 @@ import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
+import static org.mockito.Mockito.same;
+import static org.mockito.Mockito.anySet;
+import static org.mockito.Mockito.anyMap;
 
 public class StandardNiFiServiceFacadeTest {
 
@@ -381,6 +389,62 @@ public class StandardNiFiServiceFacadeTest {
         assertNull(versionedFlowSnapshot.getSnapshotMetadata());
     }
 
+    @Test
+    public void testGetCurrentFlowSnapshotByGroupIdWithReferencedControllerServices() {
+        final String groupId = UUID.randomUUID().toString();
+        final ProcessGroup processGroup = mock(ProcessGroup.class);
+        final ProcessGroup parentProcessGroup = mock(ProcessGroup.class);
+
+        final Set<ControllerServiceNode> parentControllerServices = new HashSet<>();
+        final ControllerServiceNode parentControllerService1 = mock(ControllerServiceNode.class);
+        final ControllerServiceNode parentControllerService2 = mock(ControllerServiceNode.class);
+        parentControllerServices.add(parentControllerService1);
+        parentControllerServices.add(parentControllerService2);
+
+        when(processGroupDAO.getProcessGroup(groupId)).thenReturn(processGroup);
+        when(processGroup.getParent()).thenReturn(parentProcessGroup);
+        when(parentProcessGroup.getControllerServices(anyBoolean())).thenReturn(parentControllerServices);
+
+        final FlowManager flowManager = mock(FlowManager.class);
+        final ExtensionManager extensionManager = mock(ExtensionManager.class);
+        when(flowController.getFlowManager()).thenReturn(flowManager);
+        when(flowController.getExtensionManager()).thenReturn(extensionManager);
+
+        final ControllerServiceProvider controllerServiceProvider = mock(ControllerServiceProvider.class);
+        when(flowController.getControllerServiceProvider()).thenReturn(controllerServiceProvider);
+
+        final VersionControlInformation versionControlInformation = mock(VersionControlInformation.class);
+        when(processGroup.getVersionControlInformation()).thenReturn(versionControlInformation);
+
+        // use spy to mock the make() method for generating a new flow mapper to make this testable
+        final StandardNiFiServiceFacade serviceFacadeSpy = spy(serviceFacade);
+        final NiFiRegistryFlowMapper flowMapper = mock(NiFiRegistryFlowMapper.class);
+        when(serviceFacadeSpy.makeNiFiRegistryFlowMapper(extensionManager)).thenReturn(flowMapper);
+
+        final InstantiatedVersionedProcessGroup nonVersionedProcessGroup = spy(new InstantiatedVersionedProcessGroup(UUID.randomUUID().toString(), UUID.randomUUID().toString()));
+        when(flowMapper.mapNonVersionedProcessGroup(processGroup, controllerServiceProvider)).thenReturn(nonVersionedProcessGroup);
+
+        final VersionedControllerService versionedControllerService1 = mock(VersionedControllerService.class);
+        final VersionedControllerService versionedControllerService2 = mock(VersionedControllerService.class);
+
+        Mockito.when(versionedControllerService1.getIdentifier()).thenReturn("test");
+        Mockito.when(versionedControllerService2.getIdentifier()).thenReturn("test2");
+
+        when(flowMapper.mapControllerService(same(parentControllerService1), same(controllerServiceProvider), anySet(), anyMap())).thenReturn(versionedControllerService1);
+        when(flowMapper.mapControllerService(same(parentControllerService2), same(controllerServiceProvider), anySet(), anyMap())).thenReturn(versionedControllerService2);
+        when(flowMapper.mapParameterContexts(processGroup, true)).thenReturn(new HashMap<>());
+
+        final ExternalControllerServiceReference externalControllerServiceReference = mock(ExternalControllerServiceReference.class);
+        final Map<String, ExternalControllerServiceReference> externalControllerServiceReferences = new LinkedHashMap<>();
+        externalControllerServiceReferences.put("test", externalControllerServiceReference);
+        when(nonVersionedProcessGroup.getExternalControllerServiceReferences()).thenReturn(externalControllerServiceReferences);
+
+        final VersionedFlowSnapshot versionedFlowSnapshot = serviceFacadeSpy.getCurrentFlowSnapshotByGroupIdWithReferencedControllerServices(groupId);
+
+        assertEquals(1, versionedFlowSnapshot.getFlowContents().getControllerServices().size());
+        assertEquals("test", versionedFlowSnapshot.getFlowContents().getControllerServices().iterator().next().getIdentifier());
+    }
+
     @Test
     public void testIsAnyProcessGroupUnderVersionControl_None() {
         final String groupId = UUID.randomUUID().toString();
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/api/TestProcessGroupResource.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/api/TestProcessGroupResource.java
index cc74c3dd26..ed28dfe72e 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/api/TestProcessGroupResource.java
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/test/java/org/apache/nifi/web/api/TestProcessGroupResource.java
@@ -53,7 +53,7 @@ public class TestProcessGroupResource {
         when(versionedFlowSnapshot.getFlowContents()).thenReturn(versionedProcessGroup);
         when(versionedProcessGroup.getName()).thenReturn(flowName);
 
-        final Response response = processGroupResource.exportProcessGroup(groupId);
+        final Response response = processGroupResource.exportProcessGroup(groupId, false);
 
         final VersionedFlowSnapshot resultEntity = (VersionedFlowSnapshot)response.getEntity();
 
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
index ae9345dd3d..d256a9c615 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-actions.js
@@ -1718,10 +1718,24 @@
             }
         },
 
+        /**
+         * Downloads the current flow, without including the external Controller Services
+         */
+        downloadFlowWithoutExternalServices: function (selection) {
+            this.downloadFlow(selection, false);
+        },
+
+        /**
+         * Downloads the current flow, including the external Controller Services
+         */
+        downloadFlowWithExternalServices: function (selection) {
+            this.downloadFlow(selection, true);
+        },
+
         /**
          * Downloads the current flow
          */
-        downloadFlow: function (selection) {
+        downloadFlow: function (selection,includeReferencedServices) {
             var processGroupId = null;
 
             if (selection.empty()) {
@@ -1737,7 +1751,7 @@
                 var parameters = {};
 
                 // open the url
-                var uri = '../nifi-api/process-groups/' + encodeURIComponent(processGroupId) + '/download';
+                var uri = '../nifi-api/process-groups/' + encodeURIComponent(processGroupId) + '/download?includeReferencedServices=' + includeReferencedServices;
                 window.open(uri);
             }
         },
diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js
index fd9ec47664..bd0460ecb0 100644
--- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js
+++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-context-menu.js
@@ -861,7 +861,10 @@
         {id: 'move-into-parent-menu-item', condition: canMoveToParent, menuItem: {clazz: 'fa fa-arrows', text: 'Move to parent group', action: 'moveIntoParent'}},
         {id: 'group-menu-item', condition: canGroup, menuItem: {clazz: 'icon icon-group', text: 'Group', action: 'group'}},
         {separator: true},
-        {id: 'download-menu-item', condition: supportsDownloadFlow, menuItem: {clazz: 'fa', text: 'Download flow definition', action: 'downloadFlow'}},
+        {id: 'download-menu-item', groupMenuItem: {clazz: 'fa', text: 'Download flow definition'}, menuItems: [
+            {id: 'download-menu-item-without', condition: hasUpstream, menuItem: {clazz: 'fa', text: 'Without external services', action: 'downloadFlowWithoutExternalServices'}},
+            {id: 'download-menu-item-with', condition: hasDownstream, menuItem: {clazz: 'fa', text: 'With external services', action: 'downloadFlowWithExternalServices'}}
+        ]},
         {separator: true},
         {id: 'upload-template-menu-item', condition: canUploadTemplate, menuItem: {clazz: 'icon icon-template-import', text: 'Upload template', action: 'uploadTemplate'}},
         {id: 'template-menu-item', condition: canCreateTemplate, menuItem: {clazz: 'icon icon-template-save', text: 'Create template', action: 'template'}},


[nifi] 03/04: NIFI-9917 fix the tooltip of "delivery guarantee/best effort" to a more accurate one

Posted by jo...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

joewitt pushed a commit to branch support/nifi-1.16
in repository https://gitbox.apache.org/repos/asf/nifi.git

commit 75105eab22de0d2eee74d0953eeca4c49541839d
Author: Nandor Soma Abonyi <ab...@gmail.com>
AuthorDate: Wed Apr 13 14:33:35 2022 +0200

    NIFI-9917 fix the tooltip of "delivery guarantee/best effort" to a more accurate one
    
    Signed-off-by: Pierre Villard <pi...@gmail.com>
    
    This closes #5963.
---
 .../apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_1_0.java   | 4 ++--
 .../org/apache/nifi/processors/kafka/pubsub/PublishKafka_1_0.java     | 4 ++--
 .../apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_2_0.java   | 4 ++--
 .../org/apache/nifi/processors/kafka/pubsub/PublishKafka_2_0.java     | 4 ++--
 .../apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_2_6.java   | 4 ++--
 .../org/apache/nifi/processors/kafka/pubsub/PublishKafka_2_6.java     | 4 ++--
 6 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-1-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_1_0.java b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-1-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_1_0.java
index 6fc1ff1048..1edd5bac67 100644
--- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-1-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_1_0.java
+++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-1-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_1_0.java
@@ -99,8 +99,8 @@ public class PublishKafkaRecord_1_0 extends AbstractProcessor {
             + "whether or not it is replicated. This is faster than <Guarantee Replicated Delivery> "
             + "but can result in data loss if a Kafka node crashes");
     static final AllowableValue DELIVERY_BEST_EFFORT = new AllowableValue("0", "Best Effort",
-        "FlowFile will be routed to success after successfully writing the content to a Kafka node, "
-            + "without waiting for a response. This provides the best performance but may result in data loss.");
+        "FlowFile will be routed to success after successfully sending the content to a Kafka node, "
+            + "without waiting for any acknowledgment from the node at all. This provides the best performance but may result in data loss.");
 
     static final AllowableValue ROUND_ROBIN_PARTITIONING = new AllowableValue(Partitioners.RoundRobinPartitioner.class.getName(),
         Partitioners.RoundRobinPartitioner.class.getSimpleName(),
diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-1-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafka_1_0.java b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-1-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafka_1_0.java
index c2fad36e8e..a0e0ecb169 100644
--- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-1-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafka_1_0.java
+++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-1-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafka_1_0.java
@@ -87,8 +87,8 @@ public class PublishKafka_1_0 extends AbstractProcessor {
             + "whether or not it is replicated. This is faster than <Guarantee Replicated Delivery> "
             + "but can result in data loss if a Kafka node crashes");
     static final AllowableValue DELIVERY_BEST_EFFORT = new AllowableValue("0", "Best Effort",
-        "FlowFile will be routed to success after successfully writing the content to a Kafka node, "
-            + "without waiting for a response. This provides the best performance but may result in data loss.");
+        "FlowFile will be routed to success after successfully sending the content to a Kafka node, "
+            + "without waiting for any acknowledgment from the node at all. This provides the best performance but may result in data loss.");
 
     static final AllowableValue ROUND_ROBIN_PARTITIONING = new AllowableValue(Partitioners.RoundRobinPartitioner.class.getName(),
         Partitioners.RoundRobinPartitioner.class.getSimpleName(),
diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_2_0.java b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_2_0.java
index 5ea0c963e7..f659bb456c 100644
--- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_2_0.java
+++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_2_0.java
@@ -106,8 +106,8 @@ public class PublishKafkaRecord_2_0 extends AbstractProcessor {
             + "whether or not it is replicated. This is faster than <Guarantee Replicated Delivery> "
             + "but can result in data loss if a Kafka node crashes");
     static final AllowableValue DELIVERY_BEST_EFFORT = new AllowableValue("0", "Best Effort",
-        "FlowFile will be routed to success after successfully writing the content to a Kafka node, "
-            + "without waiting for a response. This provides the best performance but may result in data loss.");
+        "FlowFile will be routed to success after successfully sending the content to a Kafka node, "
+            + "without waiting for any acknowledgment from the node at all. This provides the best performance but may result in data loss.");
 
     static final AllowableValue ROUND_ROBIN_PARTITIONING = new AllowableValue(Partitioners.RoundRobinPartitioner.class.getName(),
         Partitioners.RoundRobinPartitioner.class.getSimpleName(),
diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafka_2_0.java b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafka_2_0.java
index 0680e3c0cf..f3260c1f26 100644
--- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafka_2_0.java
+++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-0-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafka_2_0.java
@@ -94,8 +94,8 @@ public class PublishKafka_2_0 extends AbstractProcessor {
             + "whether or not it is replicated. This is faster than <Guarantee Replicated Delivery> "
             + "but can result in data loss if a Kafka node crashes");
     static final AllowableValue DELIVERY_BEST_EFFORT = new AllowableValue("0", "Best Effort",
-        "FlowFile will be routed to success after successfully writing the content to a Kafka node, "
-            + "without waiting for a response. This provides the best performance but may result in data loss.");
+        "FlowFile will be routed to success after successfully sending the content to a Kafka node, "
+            + "without waiting for any acknowledgment from the node at all. This provides the best performance but may result in data loss.");
 
     static final AllowableValue ROUND_ROBIN_PARTITIONING = new AllowableValue(Partitioners.RoundRobinPartitioner.class.getName(),
         Partitioners.RoundRobinPartitioner.class.getSimpleName(),
diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_2_6.java b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_2_6.java
index 439bd0aab9..ea0d7b60d4 100644
--- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_2_6.java
+++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafkaRecord_2_6.java
@@ -108,8 +108,8 @@ public class PublishKafkaRecord_2_6 extends AbstractProcessor implements Verifia
             + "whether or not it is replicated. This is faster than <Guarantee Replicated Delivery> "
             + "but can result in data loss if a Kafka node crashes");
     static final AllowableValue DELIVERY_BEST_EFFORT = new AllowableValue("0", "Best Effort",
-        "FlowFile will be routed to success after successfully writing the content to a Kafka node, "
-            + "without waiting for a response. This provides the best performance but may result in data loss.");
+        "FlowFile will be routed to success after successfully sending the content to a Kafka node, "
+            + "without waiting for any acknowledgment from the node at all. This provides the best performance but may result in data loss.");
 
     static final AllowableValue ROUND_ROBIN_PARTITIONING = new AllowableValue(Partitioners.RoundRobinPartitioner.class.getName(),
         Partitioners.RoundRobinPartitioner.class.getSimpleName(),
diff --git a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafka_2_6.java b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafka_2_6.java
index fca068d686..985831c2b4 100644
--- a/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafka_2_6.java
+++ b/nifi-nar-bundles/nifi-kafka-bundle/nifi-kafka-2-6-processors/src/main/java/org/apache/nifi/processors/kafka/pubsub/PublishKafka_2_6.java
@@ -94,8 +94,8 @@ public class PublishKafka_2_6 extends AbstractProcessor implements VerifiablePro
             + "whether or not it is replicated. This is faster than <Guarantee Replicated Delivery> "
             + "but can result in data loss if a Kafka node crashes");
     static final AllowableValue DELIVERY_BEST_EFFORT = new AllowableValue("0", "Best Effort",
-        "FlowFile will be routed to success after successfully writing the content to a Kafka node, "
-            + "without waiting for a response. This provides the best performance but may result in data loss.");
+        "FlowFile will be routed to success after successfully sending the content to a Kafka node, "
+            + "without waiting for any acknowledgment from the node at all. This provides the best performance but may result in data loss.");
 
     static final AllowableValue ROUND_ROBIN_PARTITIONING = new AllowableValue(Partitioners.RoundRobinPartitioner.class.getName(),
         Partitioners.RoundRobinPartitioner.class.getSimpleName(),