You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by sz...@apache.org on 2024/11/27 17:29:46 UTC

(nifi-minifi-cpp) branch main updated (db574c821 -> d6dcc24ed)

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

szaszm pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git


    from db574c821 MINIFICPP-2492 Free up disk space for docker tests
     new bd1182eb8 MINIFICPP-2467 PutCouchbaseKey processor and controller
     new ea16935f9 MINIFICPP-2469 Create GetCouchbaseKey processor
     new 3885493eb MINIFICPP-2470 Add SSL and mTLS authentication support to CouchbaseClusterService
     new d6dcc24ed MINIFICPP-2479 Update librdkafka and add lz4, zstd support

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:
 .clang-format                                      |  10 +-
 .github/workflows/ci.yml                           |  18 +-
 .github/workflows/verify-package.yml               |   4 +-
 CMakeLists.txt                                     |   2 +-
 CONTROLLERS.md                                     |  18 +
 LICENSE                                            | 154 +++++-
 NOTICE                                             |   3 +
 PROCESSORS.md                                      |  84 +++-
 README.md                                          |   5 +-
 Windows.md                                         |   2 +-
 bootstrap.sh                                       |   4 +-
 bstrp_functions.sh                                 |   2 +
 cmake/Asio.cmake                                   |   2 +-
 cmake/BundledLibRdKafka.cmake                      |  72 ---
 cmake/BundledRocksDB.cmake                         |   3 -
 cmake/Bustache.cmake                               |   7 +
 cmake/Couchbase.cmake                              |  45 ++
 cmake/DockerConfig.cmake                           |   3 +-
 cmake/Fetchlibrdkafka.cmake                        |  50 ++
 cmake/LZ4.cmake                                    |  22 +-
 cmake/MiNiFiOptions.cmake                          |   3 +-
 cmake/Spdlog.cmake                                 |   4 +-
 cmake/Zstd.cmake                                   |   8 +-
 cmake/fmt.cmake                                    |   4 +-
 cmake/zstd/dummy/Findzstd.cmake                    |   1 +
 docker/requirements.txt                            |   1 +
 docker/test/integration/cluster/ContainerStore.py  |  13 +
 .../test/integration/cluster/DockerTestCluster.py  |  12 +-
 .../cluster/DockerTestDirectoryBindings.py         |  10 +-
 .../cluster/checkers/CouchbaseChecker.py           |  69 +++
 .../integration/cluster/containers/Container.py    |   4 +
 .../cluster/containers/CouchbaseServerContainer.py | 125 +++++
 .../features/MiNiFi_integration_test_driver.py     |  24 +-
 docker/test/integration/features/couchbase.feature | 232 +++++++++
 docker/test/integration/features/kafka.feature     | 259 +++++-----
 docker/test/integration/features/steps/steps.py    |  51 +-
 ...rollerService.py => CouchbaseClusterService.py} |  18 +-
 .../integration/minifi/core/ControllerService.py   |   1 +
 .../Minifi_flow_json_serializer.py                 |  13 +-
 .../Minifi_flow_yaml_serializer.py                 |  38 +-
 .../{LogAttribute.py => GetCouchbaseKey.py}        |  10 +-
 .../{LogAttribute.py => PutCouchbaseKey.py}        |  10 +-
 examples/couchbase_mtls_authentication.json        |  74 +++
 examples/couchbase_mtls_authentication.yml         |  45 ++
 .../{elasticsearch => couchbase}/CMakeLists.txt    |  14 +-
 .../controllerservices/CouchbaseClusterService.cpp | 266 ++++++++++
 .../controllerservices/CouchbaseClusterService.h   | 177 +++++++
 .../couchbase/processors/GetCouchbaseKey.cpp       | 111 +++++
 extensions/couchbase/processors/GetCouchbaseKey.h  | 113 +++++
 .../couchbase/processors/PutCouchbaseKey.cpp       |  86 ++++
 extensions/couchbase/processors/PutCouchbaseKey.h  | 161 ++++++
 extensions/{aws => couchbase}/tests/CMakeLists.txt |  23 +-
 .../couchbase/tests/GetCouchbaseKeyTests.cpp       | 170 +++++++
 .../couchbase/tests/MockCouchbaseClusterService.h  | 114 +++++
 .../couchbase/tests/PutCouchbaseKeyTests.cpp       | 172 +++++++
 extensions/{librdkafka => kafka}/CMakeLists.txt    |  16 +-
 extensions/{librdkafka => kafka}/ConsumeKafka.cpp  | 193 ++++----
 extensions/kafka/ConsumeKafka.h                    | 313 ++++++++++++
 .../{librdkafka => kafka}/KafkaConnection.cpp      |  35 +-
 extensions/{librdkafka => kafka}/KafkaConnection.h |  18 +-
 .../{librdkafka => kafka}/KafkaProcessorBase.cpp   |  28 +-
 extensions/kafka/KafkaProcessorBase.h              | 110 +++++
 .../KafkaTopic.h}                                  |  23 +-
 extensions/{librdkafka => kafka}/PublishKafka.cpp  | 550 +++++++++++----------
 extensions/kafka/PublishKafka.h                    | 288 +++++++++++
 extensions/{librdkafka => kafka}/rdkafka_utils.cpp |  46 +-
 extensions/{librdkafka => kafka}/rdkafka_utils.h   |  76 ++-
 .../{librdkafka => kafka}/tests/CMakeLists.txt     |   6 +-
 .../tests/PublishKafkaTests.cpp                    |  34 ++
 extensions/librdkafka/ConsumeKafka.h               | 273 ----------
 extensions/librdkafka/KafkaProcessorBase.h         | 107 ----
 extensions/librdkafka/KafkaTopic.h                 |  57 ---
 extensions/librdkafka/PublishKafka.h               | 253 ----------
 libminifi/include/Exception.h                      |   2 +-
 libminifi/include/core/Processor.h                 |   4 +-
 libminifi/include/utils/SmallString.h              |   2 +-
 .../controller/StandardControllerServiceNode.cpp   |  15 +-
 thirdparty/bustache/add-append.patch               |  18 +
 thirdparty/couchbase/remove-thirdparty.patch       | 172 +++++++
 .../0001-remove-findLZ4-and-findZSTD.patch         |  92 ++++
 thirdparty/librdkafka/high-cpu.patch               | 185 -------
 win_build_vs.bat                                   |   6 +-
 82 files changed, 4192 insertions(+), 1676 deletions(-)
 delete mode 100644 cmake/BundledLibRdKafka.cmake
 create mode 100644 cmake/Couchbase.cmake
 create mode 100644 cmake/Fetchlibrdkafka.cmake
 create mode 100644 docker/test/integration/cluster/checkers/CouchbaseChecker.py
 create mode 100644 docker/test/integration/cluster/containers/CouchbaseServerContainer.py
 create mode 100644 docker/test/integration/features/couchbase.feature
 copy docker/test/integration/minifi/controllers/{KubernetesControllerService.py => CouchbaseClusterService.py} (56%)
 copy docker/test/integration/minifi/processors/{LogAttribute.py => GetCouchbaseKey.py} (84%)
 copy docker/test/integration/minifi/processors/{LogAttribute.py => PutCouchbaseKey.py} (84%)
 create mode 100644 examples/couchbase_mtls_authentication.json
 create mode 100644 examples/couchbase_mtls_authentication.yml
 copy extensions/{elasticsearch => couchbase}/CMakeLists.txt (56%)
 create mode 100644 extensions/couchbase/controllerservices/CouchbaseClusterService.cpp
 create mode 100644 extensions/couchbase/controllerservices/CouchbaseClusterService.h
 create mode 100644 extensions/couchbase/processors/GetCouchbaseKey.cpp
 create mode 100644 extensions/couchbase/processors/GetCouchbaseKey.h
 create mode 100644 extensions/couchbase/processors/PutCouchbaseKey.cpp
 create mode 100644 extensions/couchbase/processors/PutCouchbaseKey.h
 copy extensions/{aws => couchbase}/tests/CMakeLists.txt (71%)
 create mode 100644 extensions/couchbase/tests/GetCouchbaseKeyTests.cpp
 create mode 100644 extensions/couchbase/tests/MockCouchbaseClusterService.h
 create mode 100644 extensions/couchbase/tests/PutCouchbaseKeyTests.cpp
 rename extensions/{librdkafka => kafka}/CMakeLists.txt (76%)
 rename extensions/{librdkafka => kafka}/ConsumeKafka.cpp (68%)
 create mode 100644 extensions/kafka/ConsumeKafka.h
 rename extensions/{librdkafka => kafka}/KafkaConnection.cpp (78%)
 rename extensions/{librdkafka => kafka}/KafkaConnection.h (85%)
 rename extensions/{librdkafka => kafka}/KafkaProcessorBase.cpp (85%)
 create mode 100644 extensions/kafka/KafkaProcessorBase.h
 copy extensions/{test-processors/LogOnDestructionProcessor.cpp => kafka/KafkaTopic.h} (62%)
 rename extensions/{librdkafka => kafka}/PublishKafka.cpp (58%)
 create mode 100644 extensions/kafka/PublishKafka.h
 rename extensions/{librdkafka => kafka}/rdkafka_utils.cpp (73%)
 rename extensions/{librdkafka => kafka}/rdkafka_utils.h (68%)
 rename extensions/{librdkafka => kafka}/tests/CMakeLists.txt (92%)
 rename extensions/{librdkafka => kafka}/tests/PublishKafkaTests.cpp (52%)
 delete mode 100644 extensions/librdkafka/ConsumeKafka.h
 delete mode 100644 extensions/librdkafka/KafkaProcessorBase.h
 delete mode 100644 extensions/librdkafka/KafkaTopic.h
 delete mode 100644 extensions/librdkafka/PublishKafka.h
 create mode 100644 thirdparty/bustache/add-append.patch
 create mode 100644 thirdparty/couchbase/remove-thirdparty.patch
 create mode 100644 thirdparty/librdkafka/0001-remove-findLZ4-and-findZSTD.patch
 delete mode 100644 thirdparty/librdkafka/high-cpu.patch


(nifi-minifi-cpp) 03/04: MINIFICPP-2470 Add SSL and mTLS authentication support to CouchbaseClusterService

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

szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 3885493eb784a571a8f3f1e06dbf5aca7b221e2a
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Wed Nov 27 13:05:21 2024 +0100

    MINIFICPP-2470 Add SSL and mTLS authentication support to CouchbaseClusterService
    
    - Add mTLS authentication option with linked SSLContextService of CouchbaseClusterService
    - Add support for adding CA certificate with linked SSLContextService to use SSL communication when using username/password authentication
    - Fix enabling linked services of a controller service before enabling the controller service itself
    
    Closes #1882
    
    Signed-off-by: Marton Szasz <sz...@apache.org>
---
 .../cluster/DockerTestDirectoryBindings.py         | 10 ++-
 .../cluster/containers/CouchbaseServerContainer.py | 88 +++++++++++++++++++---
 docker/test/integration/features/couchbase.feature | 57 ++++++++++++++
 docker/test/integration/features/steps/steps.py    | 30 +++++++-
 .../minifi/controllers/CouchbaseClusterService.py  |  9 ++-
 .../integration/minifi/core/ControllerService.py   |  1 +
 .../Minifi_flow_json_serializer.py                 | 13 ++--
 .../Minifi_flow_yaml_serializer.py                 | 38 +++++-----
 examples/couchbase_mtls_authentication.json        | 74 ++++++++++++++++++
 examples/couchbase_mtls_authentication.yml         | 45 +++++++++++
 .../controllerservices/CouchbaseClusterService.cpp | 66 ++++++++++++++--
 .../controllerservices/CouchbaseClusterService.h   | 12 +--
 .../controller/StandardControllerServiceNode.cpp   | 15 +++-
 13 files changed, 407 insertions(+), 51 deletions(-)

diff --git a/docker/test/integration/cluster/DockerTestDirectoryBindings.py b/docker/test/integration/cluster/DockerTestDirectoryBindings.py
index 87cf2b4ec..25add90ae 100644
--- a/docker/test/integration/cluster/DockerTestDirectoryBindings.py
+++ b/docker/test/integration/cluster/DockerTestDirectoryBindings.py
@@ -18,7 +18,7 @@ import shutil
 import hashlib
 import subprocess
 import OpenSSL.crypto
-from ssl_utils.SSL_cert_utils import make_self_signed_cert, make_cert_without_extended_usage, make_server_cert
+from ssl_utils.SSL_cert_utils import make_self_signed_cert, make_cert_without_extended_usage, make_server_cert, make_client_cert
 
 
 class DockerTestDirectoryBindings:
@@ -214,3 +214,11 @@ class DockerTestDirectoryBindings:
             os.path.join(base, "root_ca.crt"),
         ]
         subprocess.run(cmd, check=True)
+
+        clientuser_cert, clientuser_key = make_client_cert("clientuser", ca_cert=self.root_ca_cert, ca_key=self.root_ca_key)
+        self.put_test_resource('clientuser.crt',
+                               OpenSSL.crypto.dump_certificate(type=OpenSSL.crypto.FILETYPE_PEM,
+                                                               cert=clientuser_cert))
+        self.put_test_resource('clientuser.key',
+                               OpenSSL.crypto.dump_privatekey(type=OpenSSL.crypto.FILETYPE_PEM,
+                                                              pkey=clientuser_key))
diff --git a/docker/test/integration/cluster/containers/CouchbaseServerContainer.py b/docker/test/integration/cluster/containers/CouchbaseServerContainer.py
index 9baf01f08..b2f13b732 100644
--- a/docker/test/integration/cluster/containers/CouchbaseServerContainer.py
+++ b/docker/test/integration/cluster/containers/CouchbaseServerContainer.py
@@ -12,19 +12,67 @@
 # 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.
+import os
+import OpenSSL.crypto
+import tempfile
+import docker
+import requests
+import logging
+from requests.auth import HTTPBasicAuth
 from .Container import Container
 from utils import retry_check
+from ssl_utils.SSL_cert_utils import make_server_cert
 
 
 class CouchbaseServerContainer(Container):
     def __init__(self, feature_context, name, vols, network, image_store, command=None):
-        super().__init__(feature_context, name, 'couchbase-server', vols, network, image_store, command)
+        super().__init__(feature_context, name, "couchbase-server", vols, network, image_store, command)
+        couchbase_cert, couchbase_key = make_server_cert(f"couchbase-server-{feature_context.id}", feature_context.root_ca_cert, feature_context.root_ca_key)
+
+        self.root_ca_file = tempfile.NamedTemporaryFile(delete=False)
+        self.root_ca_file.write(OpenSSL.crypto.dump_certificate(type=OpenSSL.crypto.FILETYPE_PEM, cert=feature_context.root_ca_cert))
+        self.root_ca_file.close()
+        os.chmod(self.root_ca_file.name, 0o666)
+
+        self.couchbase_cert_file = tempfile.NamedTemporaryFile(delete=False)
+        self.couchbase_cert_file.write(OpenSSL.crypto.dump_certificate(type=OpenSSL.crypto.FILETYPE_PEM, cert=couchbase_cert))
+        self.couchbase_cert_file.close()
+        os.chmod(self.couchbase_cert_file.name, 0o666)
+
+        self.couchbase_key_file = tempfile.NamedTemporaryFile(delete=False)
+        self.couchbase_key_file.write(OpenSSL.crypto.dump_privatekey(type=OpenSSL.crypto.FILETYPE_PEM, pkey=couchbase_key))
+        self.couchbase_key_file.close()
+        os.chmod(self.couchbase_key_file.name, 0o666)
 
     def get_startup_finished_log_entry(self):
         # after startup the logs are only available in the container, only this message is shown
         return "logs available in"
 
-    @retry_check(15, 2)
+    @retry_check(max_tries=12, retry_interval=5)
+    def _run_couchbase_cli_command(self, command):
+        (code, _) = self.client.containers.get(self.name).exec_run(command)
+        if code != 0:
+            logging.error(f"Failed to run command '{command}', returned error code: {code}")
+            return False
+        return True
+
+    def _run_couchbase_cli_commands(self, commands):
+        return all(self._run_couchbase_cli_command(command) for command in commands)
+
+    @retry_check(max_tries=15, retry_interval=2)
+    def _load_couchbase_certs(self):
+        response = requests.post("http://localhost:8091/node/controller/loadTrustedCAs", auth=HTTPBasicAuth("Administrator", "password123"))
+        if response.status_code != 200:
+            logging.error(f"Failed to load CA certificates, with status code: {response.status_code}")
+            return False
+
+        response = requests.post("http://localhost:8091/node/controller/reloadCertificate", auth=HTTPBasicAuth("Administrator", "password123"))
+        if response.status_code != 200:
+            logging.error(f"Failed to reload certificates, with status code: {response.status_code}")
+            return False
+
+        return True
+
     def run_post_startup_commands(self):
         if self.post_startup_commands_finished:
             return True
@@ -33,12 +81,18 @@ class CouchbaseServerContainer(Container):
             ["couchbase-cli", "cluster-init", "-c", "localhost", "--cluster-username", "Administrator", "--cluster-password", "password123", "--services", "data,index,query",
              "--cluster-ramsize", "2048", "--cluster-index-ramsize", "256"],
             ["couchbase-cli", "bucket-create", "-c", "localhost", "--username", "Administrator", "--password", "password123", "--bucket", "test_bucket", "--bucket-type", "couchbase",
-             "--bucket-ramsize", "1024", "--max-ttl", "36000"]
+             "--bucket-ramsize", "1024", "--max-ttl", "36000"],
+            ["couchbase-cli", "user-manage", "-c", "localhost", "-u", "Administrator", "-p", "password123", "--set", "--rbac-username", "clientuser", "--rbac-password", "password123",
+             "--roles", "data_reader[test_bucket],data_writer[test_bucket]", "--auth-domain", "local"],
+            ["bash", "-c", 'tee /tmp/auth.json <<< \'{"state": "enable", "prefixes": [ {"path": "subject.cn", "prefix": "", "delimiter": "."}]}\''],
+            ['couchbase-cli', 'ssl-manage', '-c', 'localhost', '-u', 'Administrator', '-p', 'password123', '--set-client-auth', '/tmp/auth.json']
         ]
-        for command in commands:
-            (code, _) = self.client.containers.get(self.name).exec_run(command)
-            if code != 0:
-                return False
+        if not self._run_couchbase_cli_commands(commands):
+            return False
+
+        if not self._load_couchbase_certs():
+            return False
+
         self.post_startup_commands_finished = True
         return True
 
@@ -46,10 +100,26 @@ class CouchbaseServerContainer(Container):
         if not self.set_deployed():
             return
 
+        mounts = [
+            docker.types.Mount(
+                type='bind',
+                source=self.couchbase_key_file.name,
+                target='/opt/couchbase/var/lib/couchbase/inbox/pkey.key'),
+            docker.types.Mount(
+                type='bind',
+                source=self.couchbase_cert_file.name,
+                target='/opt/couchbase/var/lib/couchbase/inbox/chain.pem'),
+            docker.types.Mount(
+                type='bind',
+                source=self.root_ca_file.name,
+                target='/opt/couchbase/var/lib/couchbase/inbox/CA/root_ca.crt')
+        ]
+
         self.docker_container = self.client.containers.run(
             "couchbase:enterprise-7.2.5",
             detach=True,
             name=self.name,
             network=self.network.name,
-            ports={'11210/tcp': 11210},
-            entrypoint=self.command)
+            ports={'8091/tcp': 8091, '11210/tcp': 11210},
+            entrypoint=self.command,
+            mounts=mounts)
diff --git a/docker/test/integration/features/couchbase.feature b/docker/test/integration/features/couchbase.feature
index 646eaacd9..7b74a6c3d 100644
--- a/docker/test/integration/features/couchbase.feature
+++ b/docker/test/integration/features/couchbase.feature
@@ -173,3 +173,60 @@ Feature: Executing Couchbase operations from MiNiFi-C++
     And all instances start up
 
     Then the Minifi logs contain the following message: "Failed to get content for document 'test_doc_id' from collection 'test_bucket._default._default' with the following exception: 'raw_binary_transcoder expects document to have BINARY common flags" in less than 60 seconds
+
+  Scenario: A MiNiFi instance can get data from test bucket with GetCouchbaseKey processor using SSL connection
+    Given a GetFile processor with the "Input Directory" property set to "/tmp/input"
+    And the "Keep Source File" property of the GetFile processor is set to "true"
+    And the scheduling period of the GetFile processor is set to "20 seconds"
+    And a file with the content '{"field1": "value1", "field2": "value2"}' is present in '/tmp/input'
+    And a PutCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the PutCouchbaseKey processor is set to "test_doc_id"
+    And the "Couchbase Cluster Controller Service" property of the PutCouchbaseKey processor is set to "CouchbaseClusterService"
+    And a GetCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the GetCouchbaseKey processor is set to "test_doc_id"
+    And the "Couchbase Cluster Controller Service" property of the GetCouchbaseKey processor is set to "CouchbaseClusterService"
+    And a PutFile processor with the "Directory" property set to "/tmp/output"
+    And a LogAttribute processor with the "FlowFiles To Log" property set to "0"
+    And a CouchbaseClusterService is set up up with SSL connection with the name "CouchbaseClusterService"
+
+    And the "success" relationship of the GetFile processor is connected to the PutCouchbaseKey
+    And the "success" relationship of the PutCouchbaseKey processor is connected to the GetCouchbaseKey
+    And the "success" relationship of the GetCouchbaseKey processor is connected to the PutFile
+    And the "success" relationship of the PutFile processor is connected to the LogAttribute
+
+    When a Couchbase server is started
+    And all instances start up
+
+    Then a flowfile with the JSON content '{"field1": "value1", "field2": "value2"}' is placed in the monitored directory in less than 6000 seconds
+    And the Minifi logs contain the following message: "key:couchbase.bucket value:test_bucket" in less than 10 seconds
+    And the Minifi logs contain the following message: "key:couchbase.doc.id value:test_doc_id" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.cas value:[1-9][0-9]*" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.expiry value:\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}" in less than 1 seconds
+
+  Scenario: A MiNiFi instance can get data from test bucket with GetCouchbaseKey processor using mTLS authentication
+    Given a MiNiFi CPP server with yaml config
+    And a GetFile processor with the "Input Directory" property set to "/tmp/input"
+    And a file with the content '{"field1": "value1", "field2": "value2"}' is present in '/tmp/input'
+    And a PutCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the PutCouchbaseKey processor is set to "test_doc_id"
+    And the "Couchbase Cluster Controller Service" property of the PutCouchbaseKey processor is set to "CouchbaseClusterService"
+    And a GetCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the GetCouchbaseKey processor is set to "test_doc_id"
+    And the "Couchbase Cluster Controller Service" property of the GetCouchbaseKey processor is set to "CouchbaseClusterService"
+    And a PutFile processor with the "Directory" property set to "/tmp/output"
+    And a LogAttribute processor with the "FlowFiles To Log" property set to "0"
+    And a CouchbaseClusterService is setup up using mTLS authentication with the name "CouchbaseClusterService"
+
+    And the "success" relationship of the GetFile processor is connected to the PutCouchbaseKey
+    And the "success" relationship of the PutCouchbaseKey processor is connected to the GetCouchbaseKey
+    And the "success" relationship of the GetCouchbaseKey processor is connected to the PutFile
+    And the "success" relationship of the PutFile processor is connected to the LogAttribute
+
+    When a Couchbase server is started
+    And all instances start up
+
+    Then a flowfile with the JSON content '{"field1": "value1", "field2": "value2"}' is placed in the monitored directory in less than 6000 seconds
+    And the Minifi logs contain the following message: "key:couchbase.bucket value:test_bucket" in less than 10 seconds
+    And the Minifi logs contain the following message: "key:couchbase.doc.id value:test_doc_id" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.cas value:[1-9][0-9]*" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.expiry value:\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}" in less than 1 seconds
diff --git a/docker/test/integration/features/steps/steps.py b/docker/test/integration/features/steps/steps.py
index 6d4e464e9..70a193888 100644
--- a/docker/test/integration/features/steps/steps.py
+++ b/docker/test/integration/features/steps/steps.py
@@ -573,7 +573,7 @@ def step_impl(context):
     minifi_crt_file = '/tmp/resources/minifi_client.crt'
     minifi_key_file = '/tmp/resources/minifi_client.key'
     root_ca_crt_file = '/tmp/resources/root_ca.crt'
-    ssl_context_service = SSLContextService(cert=minifi_crt_file, ca_cert=root_ca_crt_file, key=minifi_key_file)
+    ssl_context_service = SSLContextService(name='SSLContextService', cert=minifi_crt_file, ca_cert=root_ca_crt_file, key=minifi_key_file)
 
     splunk_cert, splunk_key = make_server_cert(context.test.get_container_name_with_postfix("splunk"), context.root_ca_cert, context.root_ca_key)
     put_splunk_http = context.test.get_node_by_name("PutSplunkHTTP")
@@ -1384,6 +1384,34 @@ def step_impl(context, service_name):
     container.add_controller(couchbase_cluster_controller_service)
 
 
+@given("a CouchbaseClusterService is set up up with SSL connection with the name \"{service_name}\"")
+def step_impl(context, service_name):
+    ssl_context_service = SSLContextService(name="SSLContextService",
+                                            ca_cert='/tmp/resources/root_ca.crt')
+    container = context.test.acquire_container(context=context, name="minifi-cpp-flow")
+    container.add_controller(ssl_context_service)
+    couchbase_cluster_controller_service = CouchbaseClusterService(
+        name=service_name,
+        connection_string="couchbases://{server_hostname}".format(server_hostname=context.test.get_container_name_with_postfix("couchbase-server")),
+        ssl_context_service=ssl_context_service)
+    container.add_controller(couchbase_cluster_controller_service)
+
+
 @then("a document with id \"{doc_id}\" in bucket \"{bucket_name}\" is present with data '{data}' of type \"{data_type}\" in Couchbase")
 def step_impl(context, doc_id: str, bucket_name: str, data: str, data_type: str):
     context.test.check_is_data_present_on_couchbase(doc_id, bucket_name, data, data_type)
+
+
+@given("a CouchbaseClusterService is setup up using mTLS authentication with the name \"{service_name}\"")
+def step_impl(context, service_name):
+    ssl_context_service = SSLContextService(name="SSLContextService",
+                                            cert='/tmp/resources/clientuser.crt',
+                                            key='/tmp/resources/clientuser.key',
+                                            ca_cert='/tmp/resources/root_ca.crt')
+    container = context.test.acquire_container(context=context, name="minifi-cpp-flow")
+    container.add_controller(ssl_context_service)
+    couchbase_cluster_controller_service = CouchbaseClusterService(
+        name=service_name,
+        connection_string="couchbases://{server_hostname}".format(server_hostname=context.test.get_container_name_with_postfix("couchbase-server")),
+        ssl_context_service=ssl_context_service)
+    container.add_controller(couchbase_cluster_controller_service)
diff --git a/docker/test/integration/minifi/controllers/CouchbaseClusterService.py b/docker/test/integration/minifi/controllers/CouchbaseClusterService.py
index e06c1e6ff..94494fe17 100644
--- a/docker/test/integration/minifi/controllers/CouchbaseClusterService.py
+++ b/docker/test/integration/minifi/controllers/CouchbaseClusterService.py
@@ -18,10 +18,13 @@ from ..core.ControllerService import ControllerService
 
 
 class CouchbaseClusterService(ControllerService):
-    def __init__(self, name, connection_string):
+    def __init__(self, name, connection_string, ssl_context_service=None):
         super(CouchbaseClusterService, self).__init__(name=name)
 
         self.service_class = 'CouchbaseClusterService'
         self.properties['Connection String'] = connection_string
-        self.properties['User Name'] = "Administrator"
-        self.properties['User Password'] = "password123"
+        if ssl_context_service:
+            self.linked_services.append(ssl_context_service)
+        if not ssl_context_service or ssl_context_service and 'Client Certificate' not in ssl_context_service.properties:
+            self.properties['User Name'] = "Administrator"
+            self.properties['User Password'] = "password123"
diff --git a/docker/test/integration/minifi/core/ControllerService.py b/docker/test/integration/minifi/core/ControllerService.py
index f29513139..02d32e4a7 100644
--- a/docker/test/integration/minifi/core/ControllerService.py
+++ b/docker/test/integration/minifi/core/ControllerService.py
@@ -34,3 +34,4 @@ class ControllerService(object):
             properties = {}
 
         self.properties = properties
+        self.linked_services = []
diff --git a/docker/test/integration/minifi/flow_serialization/Minifi_flow_json_serializer.py b/docker/test/integration/minifi/flow_serialization/Minifi_flow_json_serializer.py
index c1043d506..a100ae038 100644
--- a/docker/test/integration/minifi/flow_serialization/Minifi_flow_json_serializer.py
+++ b/docker/test/integration/minifi/flow_serialization/Minifi_flow_json_serializer.py
@@ -118,12 +118,7 @@ class Minifi_flow_json_serializer:
                     continue
 
                 visited.append(svc)
-                root['controllerServices'].append({
-                    'name': svc.name,
-                    'identifier': svc.id,
-                    'type': svc.service_class,
-                    'properties': svc.properties
-                })
+                self.serialize_controller(svc, root)
 
         if isinstance(connectable, Funnel):
             root['funnels'].append({
@@ -159,3 +154,9 @@ class Minifi_flow_json_serializer:
             'type': controller.service_class,
             'properties': controller.properties
         })
+
+        if controller.linked_services:
+            if len(controller.linked_services) == 1:
+                root['controllerServices'][-1]['properties']['Linked Services'] = controller.linked_services[0].name
+            else:
+                root['controllerServices'][-1]['properties']['Linked Services'] = [{"value": service.name} for service in controller.linked_services]
diff --git a/docker/test/integration/minifi/flow_serialization/Minifi_flow_yaml_serializer.py b/docker/test/integration/minifi/flow_serialization/Minifi_flow_yaml_serializer.py
index dc912b122..14cbabc98 100644
--- a/docker/test/integration/minifi/flow_serialization/Minifi_flow_yaml_serializer.py
+++ b/docker/test/integration/minifi/flow_serialization/Minifi_flow_yaml_serializer.py
@@ -119,12 +119,7 @@ class Minifi_flow_yaml_serializer:
                     continue
 
                 visited.append(svc)
-                res['Controller Services'].append({
-                    'name': svc.name,
-                    'id': svc.id,
-                    'class': svc.service_class,
-                    'Properties': svc.properties
-                })
+                self._add_controller_service_node(svc, res)
 
         if isinstance(connectable, Funnel):
             res['Funnels'].append({
@@ -160,6 +155,25 @@ class Minifi_flow_yaml_serializer:
 
         return (res, visited)
 
+    def _add_controller_service_node(self, controller, parent):
+        if hasattr(controller, 'name'):
+            connectable_name = controller.name
+        else:
+            connectable_name = str(controller.uuid)
+
+        parent['Controller Services'].append({
+            'name': connectable_name,
+            'id': controller.id,
+            'class': controller.service_class,
+            'Properties': controller.properties
+        })
+
+        if controller.linked_services:
+            if len(controller.linked_services) == 1:
+                parent['Controller Services'][-1]['Properties']['Linked Services'] = controller.linked_services[0].name
+            else:
+                parent['Controller Services'][-1]['Properties']['Linked Services'] = [{"value": service.name} for service in controller.linked_services]
+
     def serialize_controller(self, controller, root=None):
         if root is None:
             res = {
@@ -175,16 +189,6 @@ class Minifi_flow_yaml_serializer:
         else:
             res = root
 
-        if hasattr(controller, 'name'):
-            connectable_name = controller.name
-        else:
-            connectable_name = str(controller.uuid)
-
-        res['Controller Services'].append({
-            'name': connectable_name,
-            'id': controller.id,
-            'class': controller.service_class,
-            'Properties': controller.properties
-        })
+        self._add_controller_service_node(controller, res)
 
         return res
diff --git a/examples/couchbase_mtls_authentication.json b/examples/couchbase_mtls_authentication.json
new file mode 100644
index 000000000..7ac14df25
--- /dev/null
+++ b/examples/couchbase_mtls_authentication.json
@@ -0,0 +1,74 @@
+{
+    "parameterContexts": [],
+    "rootGroup": {
+        "name": "MiNiFi Flow",
+        "processors": [
+            {
+                "name": "Get Couchbase document file from local directory",
+                "identifier": "21b1e56e-e8d5-4543-9f6b-be148f91fb02",
+                "type": "org.apache.nifi.processors.standard.GetFile",
+                "schedulingStrategy": "TIMER_DRIVEN",
+                "schedulingPeriod": "2 sec",
+                "penaltyDuration": "30 sec",
+                "properties": {
+                    "Input Directory": "/home/user/couchbase/input"
+                },
+                "autoTerminatedRelationships": [],
+                "concurrentlySchedulableTaskCount": 1
+            },
+            {
+                "name": "Insert Couchbase document",
+                "identifier": "df762d53-0f94-4611-be01-e689b8992573",
+                "type": "org.apache.nifi.processors.standard.PutCouchbaseKey",
+                "schedulingStrategy": "EVENT_DRIVEN",
+                "penaltyDuration": "30 sec",
+                "properties": {
+                    "Bucket Name": "test_bucket",
+                    "Document Id": "test_doc_id",
+                    "Couchbase Cluster Controller Service": "CouchbaseClusterService for mTLS authentication"
+                },
+                "autoTerminatedRelationships": [
+                    "success",
+                    "failure",
+                    "retry"
+                ]
+            }
+        ],
+        "controllerServices": [
+            {
+                "name": "SSLContextService for Couchbase",
+                "identifier": "33e03d54-9917-494e-8ba0-8caeb3fdf4de",
+                "type": "SSLContextService",
+                "properties": {
+                    "Client Certificate": "/home/user/couchbase/certs/clientuser.crt",
+                    "Private Key": "/home/user/couchbase/certs/clientuser.key",
+                    "CA Certificate": "/home/user/couchbase/certsroot_ca.crt"
+                }
+            },
+            {
+                "name": "CouchbaseClusterService for mTLS authentication",
+                "identifier": "747bae3c-e68e-40af-8933-02179bd6cf85",
+                "type": "CouchbaseClusterService",
+                "properties": {
+                    "Connection String": "couchbases://couchbase-server-hLkYUYq55djwrW5A26XNJD",
+                    "Linked Services": "SSLContextService for Couchbase"
+                }
+            }
+        ],
+        "connections": [
+            {
+                "identifier": "94fdd7b1-7857-44c3-8cf2-d373a5578420",
+                "name": "GetFile/success/PutCouchbaseKey",
+                "source": {
+                    "id": "21b1e56e-e8d5-4543-9f6b-be148f91fb02"
+                },
+                "destination": {
+                    "id": "df762d53-0f94-4611-be01-e689b8992573"
+                },
+                "selectedRelationships": [
+                    "success"
+                ]
+            }
+        ],
+    }
+}
diff --git a/examples/couchbase_mtls_authentication.yml b/examples/couchbase_mtls_authentication.yml
new file mode 100644
index 000000000..7ef1033e7
--- /dev/null
+++ b/examples/couchbase_mtls_authentication.yml
@@ -0,0 +1,45 @@
+Flow Controller:
+  name: MiNiFi Flow
+Processors:
+- id: 21b1e56e-e8d5-4543-9f6b-be148f91fb02
+  name: Get Couchbase document file from local directory
+  class: org.apache.nifi.processors.standard.GetFile
+  scheduling strategy: TIMER_DRIVEN
+  scheduling period: 2 sec
+  penalization period: 30 sec
+  Properties:
+    Input Directory: /tmp/input
+  auto-terminated relationships list: []
+- id: df762d53-0f94-4611-be01-e689b8992573
+  name: Insert Couchbase document
+  class: org.apache.nifi.processors.standard.PutCouchbaseKey
+  scheduling strategy: EVENT_DRIVEN
+  penalization period: 30 sec
+  Properties:
+    Bucket Name: test_bucket
+    Couchbase Cluster Controller Service: CouchbaseClusterService for mTLS authentication
+    Document Id: test_doc_id
+  auto-terminated relationships list:
+  - success
+  - failure
+  - retry
+Controller Services:
+- id: 33e03d54-9917-494e-8ba0-8caeb3fdf4de
+  name: SSLContextService for Couchbase
+  class: SSLContextService
+  Properties:
+    CA Certificate: /tmp/resources/root_ca.crt
+    Client Certificate: /tmp/resources/clientuser.crt
+    Private Key: /tmp/resources/clientuser.key
+- id: 747bae3c-e68e-40af-8933-02179bd6cf85
+  name: CouchbaseClusterService for mTLS authentication
+  class: CouchbaseClusterService
+  Properties:
+    Connection String: couchbases://couchbase-server-VPQDsPD2pj35q5WzHNt9ER
+    Linked Services: SSLContextService for Couchbase
+Connections:
+- id: 94fdd7b1-7857-44c3-8cf2-d373a5578420
+  destination id: df762d53-0f94-4611-be01-e689b8992573
+  name: GetFile/success/PutCouchbaseKey
+  source id: 21b1e56e-e8d5-4543-9f6b-be148f91fb02
+  source relationship name: success
diff --git a/extensions/couchbase/controllerservices/CouchbaseClusterService.cpp b/extensions/couchbase/controllerservices/CouchbaseClusterService.cpp
index c40697cf7..ac340f864 100644
--- a/extensions/couchbase/controllerservices/CouchbaseClusterService.cpp
+++ b/extensions/couchbase/controllerservices/CouchbaseClusterService.cpp
@@ -50,6 +50,50 @@ CouchbaseErrorType getErrorType(const std::error_code& error_code) {
 
 }  // namespace
 
+CouchbaseClient::CouchbaseClient(std::string connection_string, std::string username, std::string password, minifi::controllers::SSLContextService* ssl_context_service,
+  const std::shared_ptr<core::logging::Logger>& logger)
+    : connection_string_(std::move(connection_string)), logger_(logger), cluster_options_(buildClusterOptions(std::move(username), std::move(password), ssl_context_service)) {
+}
+
+::couchbase::cluster_options CouchbaseClient::buildClusterOptions(std::string username, std::string password, minifi::controllers::SSLContextService* ssl_context_service) {
+  if (username.empty() && (!ssl_context_service || (ssl_context_service && ssl_context_service->getCertificateFile().empty()))) {
+    throw minifi::Exception(ExceptionType::PROCESS_SCHEDULE_EXCEPTION, "Neither username and password nor SSLContextService is provided for Couchbase authentication");
+  }
+
+  if (!username.empty() && ssl_context_service && !ssl_context_service->getCertificateFile().empty()) {
+    throw minifi::Exception(ExceptionType::PROCESS_SCHEDULE_EXCEPTION, "Either username and password or mTLS certificate authentication should be used in the SSLContextService for Couchbase, "
+      "but not both");
+  }
+
+  if (!username.empty()) {
+    logger_->log_debug("Using username and password authentication for Couchbase server");
+    if (password.empty()) {
+      throw minifi::Exception(ExceptionType::PROCESS_SCHEDULE_EXCEPTION, "Password missing for Couchbase server authentication");
+    }
+    ::couchbase::cluster_options cluster_options(std::move(username), std::move(password));
+    if (ssl_context_service && !ssl_context_service->getCACertificate().empty()) {
+      logger_->log_debug("Setting Couchbase client CA certificate path to '{}'", ssl_context_service->getCACertificate().string());
+      cluster_options.security().trust_certificate(ssl_context_service->getCACertificate().string());
+    }
+    return cluster_options;
+  }
+
+  logger_->log_debug("Using mTLS authentication for Couchbase server");
+  logger_->log_debug("Setting Couchbase client SSL key file path to '{}'", ssl_context_service->getPrivateKeyFile().string());
+  logger_->log_debug("Setting Couchbase client certificate file path to '{}'", ssl_context_service->getCertificateFile().string());
+  if (ssl_context_service->getPrivateKeyFile().empty() || ssl_context_service->getCertificateFile().empty()) {
+    throw minifi::Exception(ExceptionType::PROCESS_SCHEDULE_EXCEPTION, "Couchbase client private key path or client certificate path is empty");
+  }
+
+  ::couchbase::cluster_options cluster_options(::couchbase::certificate_authenticator(ssl_context_service->getCertificateFile().string(), ssl_context_service->getPrivateKeyFile().string()));
+  if (!ssl_context_service->getCACertificate().empty()) {
+    logger_->log_debug("Setting Couchbase client CA certificate path to '{}'", ssl_context_service->getCACertificate().string());
+    cluster_options.security().trust_certificate(ssl_context_service->getCACertificate().string());
+  }
+  cluster_options.security().tls_verify(::couchbase::tls_verify_mode::peer);
+  return cluster_options;
+}
+
 nonstd::expected<::couchbase::collection, CouchbaseErrorType> CouchbaseClient::getCollection(const CouchbaseCollection& collection) {
   auto connection_result = establishConnection();
   if (!connection_result) {
@@ -155,8 +199,7 @@ nonstd::expected<void, CouchbaseErrorType> CouchbaseClient::establishConnection(
     return {};
   }
 
-  auto options = ::couchbase::cluster_options(username_, password_);
-  auto [connect_err, cluster] = ::couchbase::cluster::connect(connection_string_, options).get();
+  auto [connect_err, cluster] = ::couchbase::cluster::connect(connection_string_, cluster_options_).get();
   if (connect_err.ec()) {
     logger_->log_error("Failed to connect to Couchbase cluster with error code: '{}' and message: '{}'", connect_err.ec(), connect_err.message());
     return nonstd::make_unexpected(getErrorType(connect_err.ec()));
@@ -179,11 +222,24 @@ void CouchbaseClusterService::onEnable() {
   getProperty(UserName, username);
   std::string password;
   getProperty(UserPassword, password);
-  if (connection_string.empty() || username.empty() || password.empty()) {
-    throw minifi::Exception(ExceptionType::PROCESS_SCHEDULE_EXCEPTION, "Missing connection string, username or password");
+  if (connection_string.empty()) {
+    throw minifi::Exception(ExceptionType::PROCESS_SCHEDULE_EXCEPTION, "Missing connection string");
+  }
+
+  if ((username.empty() || password.empty()) && linked_services_.empty()) {
+    throw minifi::Exception(ExceptionType::PROCESS_SCHEDULE_EXCEPTION, "Missing username and password or SSLContextService as a linked service");
+  }
+
+  minifi::controllers::SSLContextService* ssl_context_service_ptr = nullptr;
+  if (!linked_services_.empty()) {
+    auto ssl_context_service = std::dynamic_pointer_cast<minifi::controllers::SSLContextService>(linked_services_[0]);
+    if (!ssl_context_service) {
+      throw minifi::Exception(ExceptionType::PROCESS_SCHEDULE_EXCEPTION, "Linked service is not an SSLContextService");
+    }
+    ssl_context_service_ptr = ssl_context_service.get();
   }
+  client_ = std::make_unique<CouchbaseClient>(connection_string, username, password, ssl_context_service_ptr, logger_);
 
-  client_ = std::make_unique<CouchbaseClient>(connection_string, username, password, logger_);
   auto result = client_->establishConnection();
   if (!result) {
     if (result.error() == CouchbaseErrorType::FATAL) {
diff --git a/extensions/couchbase/controllerservices/CouchbaseClusterService.h b/extensions/couchbase/controllerservices/CouchbaseClusterService.h
index 28c6390dd..217449723 100644
--- a/extensions/couchbase/controllerservices/CouchbaseClusterService.h
+++ b/extensions/couchbase/controllerservices/CouchbaseClusterService.h
@@ -31,6 +31,7 @@
 #include "couchbase/cluster.hxx"
 #include "core/ProcessContext.h"
 #include "core/logging/LoggerConfiguration.h"
+#include "controllers/SSLContextService.h"
 
 namespace org::apache::nifi::minifi::couchbase {
 
@@ -69,9 +70,8 @@ enum class CouchbaseErrorType {
 
 class CouchbaseClient {
  public:
-  CouchbaseClient(std::string connection_string, std::string username, std::string password, const std::shared_ptr<core::logging::Logger>& logger)
-    : connection_string_(std::move(connection_string)), username_(std::move(username)), password_(std::move(password)), logger_(logger) {
-  }
+  CouchbaseClient(std::string connection_string, std::string username, std::string password, controllers::SSLContextService* ssl_context_service,
+    const std::shared_ptr<core::logging::Logger>& logger);
 
   ~CouchbaseClient() {
     close();
@@ -89,14 +89,14 @@ class CouchbaseClient {
   void close();
 
  private:
+  ::couchbase::cluster_options buildClusterOptions(std::string username, std::string password, minifi::controllers::SSLContextService* ssl_context_service);
   nonstd::expected<::couchbase::collection, CouchbaseErrorType> getCollection(const CouchbaseCollection& collection);
 
   std::string connection_string_;
-  std::string username_;
-  std::string password_;
+  std::shared_ptr<core::logging::Logger> logger_;
+  ::couchbase::cluster_options cluster_options_;
   std::mutex cluster_mutex_;
   std::optional<::couchbase::cluster> cluster_;
-  std::shared_ptr<core::logging::Logger> logger_;
 };
 
 namespace controllers {
diff --git a/libminifi/src/core/controller/StandardControllerServiceNode.cpp b/libminifi/src/core/controller/StandardControllerServiceNode.cpp
index 6bc423b15..0d63420d0 100644
--- a/libminifi/src/core/controller/StandardControllerServiceNode.cpp
+++ b/libminifi/src/core/controller/StandardControllerServiceNode.cpp
@@ -23,11 +23,13 @@
 namespace org::apache::nifi::minifi::core::controller {
 
 bool StandardControllerServiceNode::enable() {
-  Property property("Linked Services", "Referenced Controller Services");
-  controller_service_->setState(ENABLED);
   logger_->log_trace("Enabling CSN {}", getName());
+  if (active) {
+    logger_->log_debug("CSN {} is already enabled", getName());
+    return true;
+  }
+  Property property("Linked Services", "Referenced Controller Services");
   if (getProperty(property.getName(), property)) {
-    active = true;
     for (const auto& linked_service : property.getValues()) {
       ControllerServiceNode* csNode = provider->getControllerServiceNode(linked_service, controller_service_->getUUID());
       if (nullptr != csNode) {
@@ -40,13 +42,20 @@ bool StandardControllerServiceNode::enable() {
   if (nullptr != impl) {
     std::lock_guard<std::mutex> lock(mutex_);
     std::vector<std::shared_ptr<ControllerService>> services;
+    std::vector<ControllerServiceNode*> service_nodes;
     services.reserve(linked_controller_services_.size());
     for (const auto& service : linked_controller_services_) {
       services.push_back(service->getControllerServiceImplementation());
+      if (!service->enable()) {
+        logger_->log_debug("Linked Service '{}' could not be enabled", service->getName());
+        return false;
+      }
     }
     impl->setLinkedControllerServices(services);
     impl->onEnable();
   }
+  active = true;
+  controller_service_->setState(ENABLED);
   return true;
 }
 


(nifi-minifi-cpp) 02/04: MINIFICPP-2469 Create GetCouchbaseKey processor

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

szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit ea16935f9cbb30864a36bc78e2a9ce47ba039d5b
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Wed Nov 27 12:56:07 2024 +0100

    MINIFICPP-2469 Create GetCouchbaseKey processor
    
    Closes #1881
    
    Signed-off-by: Marton Szasz <sz...@apache.org>
---
 PROCESSORS.md                                      |  40 +++++
 README.md                                          |   2 +-
 .../cluster/containers/CouchbaseServerContainer.py |   4 +-
 docker/test/integration/features/couchbase.feature | 108 +++++++++++++
 .../{PutCouchbaseKey.py => GetCouchbaseKey.py}     |   8 +-
 .../minifi/processors/PutCouchbaseKey.py           |   2 +-
 .../controllerservices/CouchbaseClusterService.cpp |  76 ++++++---
 .../controllerservices/CouchbaseClusterService.h   |  17 ++-
 .../couchbase/processors/GetCouchbaseKey.cpp       | 111 ++++++++++++++
 .../{PutCouchbaseKey.h => GetCouchbaseKey.h}       |  96 +++---------
 extensions/couchbase/processors/PutCouchbaseKey.h  |   2 +-
 .../couchbase/tests/GetCouchbaseKeyTests.cpp       | 170 +++++++++++++++++++++
 .../couchbase/tests/MockCouchbaseClusterService.h  |  35 ++++-
 libminifi/include/core/Processor.h                 |   4 +-
 14 files changed, 573 insertions(+), 102 deletions(-)

diff --git a/PROCESSORS.md b/PROCESSORS.md
index eec26bbac..667130ab4 100644
--- a/PROCESSORS.md
+++ b/PROCESSORS.md
@@ -48,6 +48,7 @@ limitations under the License.
 - [FetchSmb](#FetchSmb)
 - [FocusArchiveEntry](#FocusArchiveEntry)
 - [GenerateFlowFile](#GenerateFlowFile)
+- [GetCouchbaseKey](#GetCouchbaseKey)
 - [GetFile](#GetFile)
 - [GetTCP](#GetTCP)
 - [HashContent](#HashContent)
@@ -1096,6 +1097,45 @@ In the list below, the names of required properties appear in bold. Any other pr
 | success | success operational on the flow record |
 
 
+## GetCouchbaseKey
+
+### Description
+
+Get a document from Couchbase Server via Key/Value access. The ID of the document to fetch may be supplied by setting the <Document Id> property. NOTE: if the Document Id property is not set, the contents of the FlowFile will be read to determine the Document Id, which means that the contents of the entire FlowFile will be buffered in memory.
+
+### Properties
+
+In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
+
+| Name                                     | Default Value | Allowable Values           | Description                                                                                                                                                                                                                                    |
+|------------------------------------------|---------------|----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **Couchbase Cluster Controller Service** |               |                            | A Couchbase Cluster Controller Service which manages connections to a Couchbase cluster.                                                                                                                                                       |
+| **Bucket Name**                          | default       |                            | The name of bucket to access.<br/>**Supports Expression Language: true**                                                                                                                                                                       |
+| Scope Name                               |               |                            | Scope to use inside the bucket. If not specified, the _default scope is used.<br/>**Supports Expression Language: true**                                                                                                                       |
+| Collection Name                          |               |                            | Collection to use inside the bucket scope. If not specified, the _default collection is used.<br/>**Supports Expression Language: true**                                                                                                       |
+| **Document Type**                        | Json          | Json<br/>Binary<br/>String | Content type of the retrieved value.                                                                                                                                                                                                           |
+| Document Id                              |               |                            | A static, fixed Couchbase document id, or an expression to construct the Couchbase document id.<br/>**Supports Expression Language: true**                                                                                                     |
+| Put Value to Attribute                   |               |                            | If set, the retrieved value will be put into an attribute of the FlowFile instead of a the content of the FlowFile. The attribute key to put to is determined by evaluating value of this property.<br/>**Supports Expression Language: true** |
+
+### Relationships
+
+| Name     | Description                                                                                                                                                         |
+|----------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| success  | Values retrieved from Couchbase Server are written as outgoing FlowFiles content or put into an attribute of the incoming FlowFile and routed to this relationship. |
+| failure  | All FlowFiles failed to fetch from Couchbase Server and not retry-able are routed to this relationship.                                                             |
+| retry    | All FlowFiles failed to fetch from Couchbase Server but can be retried are routed to this relationship.                                                             |
+| original | The original input FlowFile is routed to this relationship when the value is retrieved from Couchbase Server and routed to 'success'.                               |
+
+### Output Attributes
+
+| Attribute            | Relationship | Description                           |
+|----------------------|--------------|---------------------------------------|
+| couchbase.bucket     | success      | Bucket where the document was stored. |
+| couchbase.doc.id     | success      | Id of the document.                   |
+| couchbase.doc.cas    | success      | CAS of the document.                  |
+| couchbase.doc.expiry | success      | Expiration of the document.           |
+
+
 ## GetFile
 
 ### Description
diff --git a/README.md b/README.md
index 069d142ad..3c659f335 100644
--- a/README.md
+++ b/README.md
@@ -75,7 +75,7 @@ The next table outlines CMAKE flags that correspond with MiNiFi extensions. Exte
 | AWS                              | [AWSCredentialsService](CONTROLLERS.md#awscredentialsservice)<br/>[PutS3Object](PROCESSORS.md#puts3object)<br/>[DeleteS3Object](PROCESSORS.md#deletes3object)<br/>[FetchS3Object](PROCESSORS.md#fetchs3object)<br/>[ListS3](PROCESSORS.md#lists3)                                                                                                                                                                                                                       [...]
 | Azure                            | [AzureStorageCredentialsService](CONTROLLERS.md#azurestoragecredentialsservice)<br/>[PutAzureBlobStorage](PROCESSORS.md#putazureblobstorage)<br/>[DeleteAzureBlobStorage](PROCESSORS.md#deleteazureblobstorage)<br/>[FetchAzureBlobStorage](PROCESSORS.md#fetchazureblobstorage)<br/>[ListAzureBlobStorage](PROCESSORS.md#listazureblobstorage)<br/>[PutAzureDataLakeStorage](PROCESSORS.md#putazuredatalakestorage)<br/>[DeleteAzureDataLakeStorage](PROCESSORS.md#del [...]
 | CivetWeb                         | [ListenHTTP](PROCESSORS.md#listenhttp)                                                                                                                                                                                                                                                                                                                                                                                                                                  [...]
-| Couchbase                        | [CouchbaseClusterService](CONTROLLERS.md#couchbaseclusterservice)<br/>[PutCouchbaseKey](PROCESSORS.md#putcouchbasekey)                                                                                                                                                                                                                                                                                                                                                  [...]
+| Couchbase                        | [CouchbaseClusterService](CONTROLLERS.md#couchbaseclusterservice)<br/>[PutCouchbaseKey](PROCESSORS.md#putcouchbasekey)<br/>[GetCouchbaseKey](PROCESSORS.md#getcouchbasekey)                                                                                                                                                                                                                                                                                             [...]
 | Elasticsearch                    | [ElasticsearchCredentialsControllerService](CONTROLLERS.md#elasticsearchcredentialscontrollerservice)<br/>[PostElasticsearch](PROCESSORS.md#postelasticsearch)                                                                                                                                                                                                                                                                                                          [...]
 | ExecuteProcess (Linux and macOS) | [ExecuteProcess](PROCESSORS.md#executeprocess)                                                                                                                                                                                                                                                                                                                                                                                                                          [...]
 | Google Cloud Platform            | [DeleteGCSObject](PROCESSORS.md#deletegcsobject)<br>[FetchGCSObject](PROCESSORS.md#fetchgcsobject)<br>[GCPCredentialsControllerService](CONTROLLERS.md#gcpcredentialscontrollerservice)<br>[ListGCSBucket](PROCESSORS.md#listgcsbucket)<br>[PutGCSObject](PROCESSORS.md#putgcsobject)                                                                                                                                                                                   [...]
diff --git a/docker/test/integration/cluster/containers/CouchbaseServerContainer.py b/docker/test/integration/cluster/containers/CouchbaseServerContainer.py
index 1c4353046..9baf01f08 100644
--- a/docker/test/integration/cluster/containers/CouchbaseServerContainer.py
+++ b/docker/test/integration/cluster/containers/CouchbaseServerContainer.py
@@ -33,7 +33,7 @@ class CouchbaseServerContainer(Container):
             ["couchbase-cli", "cluster-init", "-c", "localhost", "--cluster-username", "Administrator", "--cluster-password", "password123", "--services", "data,index,query",
              "--cluster-ramsize", "2048", "--cluster-index-ramsize", "256"],
             ["couchbase-cli", "bucket-create", "-c", "localhost", "--username", "Administrator", "--password", "password123", "--bucket", "test_bucket", "--bucket-type", "couchbase",
-             "--bucket-ramsize", "1024"]
+             "--bucket-ramsize", "1024", "--max-ttl", "36000"]
         ]
         for command in commands:
             (code, _) = self.client.containers.get(self.name).exec_run(command)
@@ -47,7 +47,7 @@ class CouchbaseServerContainer(Container):
             return
 
         self.docker_container = self.client.containers.run(
-            "couchbase:community-7.6.2",
+            "couchbase:enterprise-7.2.5",
             detach=True,
             name=self.name,
             network=self.network.name,
diff --git a/docker/test/integration/features/couchbase.feature b/docker/test/integration/features/couchbase.feature
index 446821f25..646eaacd9 100644
--- a/docker/test/integration/features/couchbase.feature
+++ b/docker/test/integration/features/couchbase.feature
@@ -65,3 +65,111 @@ Feature: Executing Couchbase operations from MiNiFi-C++
     And the Minifi logs match the following regex: "key:couchbase.partition.uuid value:[1-9][0-9]*" in less than 1 seconds
     And the Minifi logs match the following regex: "key:couchbase.partition.id value:[1-9][0-9]*" in less than 1 seconds
     And a document with id "test_doc_id" in bucket "test_bucket" is present with data '{"field1": "value1"}' of type "Binary" in Couchbase
+
+  Scenario: A MiNiFi instance can get data from test bucket with GetCouchbaseKey processor
+    Given a GetFile processor with the "Input Directory" property set to "/tmp/input"
+    And a file with the content '{"field1": "value1", "field2": "value2"}' is present in '/tmp/input'
+    And a PutCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the PutCouchbaseKey processor is set to "test_doc_id"
+    And the "Couchbase Cluster Controller Service" property of the PutCouchbaseKey processor is set to "CouchbaseClusterService"
+    And a GetCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the GetCouchbaseKey processor is set to "test_doc_id"
+    And the "Couchbase Cluster Controller Service" property of the GetCouchbaseKey processor is set to "CouchbaseClusterService"
+    And a PutFile processor with the "Directory" property set to "/tmp/output"
+    And a LogAttribute processor with the "FlowFiles To Log" property set to "0"
+    And a CouchbaseClusterService is setup up with the name "CouchbaseClusterService"
+
+    And the "success" relationship of the GetFile processor is connected to the PutCouchbaseKey
+    And the "success" relationship of the PutCouchbaseKey processor is connected to the GetCouchbaseKey
+    And the "success" relationship of the GetCouchbaseKey processor is connected to the PutFile
+    And the "success" relationship of the PutFile processor is connected to the LogAttribute
+
+    When a Couchbase server is started
+    And all instances start up
+
+    Then a flowfile with the JSON content '{"field1": "value1", "field2": "value2"}' is placed in the monitored directory in less than 60 seconds
+    And the Minifi logs contain the following message: "key:couchbase.bucket value:test_bucket" in less than 10 seconds
+    And the Minifi logs contain the following message: "key:couchbase.doc.id value:test_doc_id" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.cas value:[1-9][0-9]*" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.expiry value:\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}" in less than 1 seconds
+
+  Scenario: A MiNiFi instance can get data from test bucket with GetCouchbaseKey processor using binary storage
+    Given a GetFile processor with the "Input Directory" property set to "/tmp/input"
+    And a file with the content '{"field1": "value1", "field2": "value2"}' is present in '/tmp/input'
+    And a PutCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the PutCouchbaseKey processor is set to "test_doc_id"
+    And the "Document Type" property of the PutCouchbaseKey processor is set to "Binary"
+    And the "Couchbase Cluster Controller Service" property of the PutCouchbaseKey processor is set to "CouchbaseClusterService"
+    And a GetCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the GetCouchbaseKey processor is set to "test_doc_id"
+    And the "Document Type" property of the GetCouchbaseKey processor is set to "Binary"
+    And the "Couchbase Cluster Controller Service" property of the GetCouchbaseKey processor is set to "CouchbaseClusterService"
+    And a PutFile processor with the "Directory" property set to "/tmp/output"
+    And a LogAttribute processor with the "FlowFiles To Log" property set to "0"
+    And a CouchbaseClusterService is setup up with the name "CouchbaseClusterService"
+
+    And the "success" relationship of the GetFile processor is connected to the PutCouchbaseKey
+    And the "success" relationship of the PutCouchbaseKey processor is connected to the GetCouchbaseKey
+    And the "success" relationship of the GetCouchbaseKey processor is connected to the PutFile
+    And the "success" relationship of the PutFile processor is connected to the LogAttribute
+
+    When a Couchbase server is started
+    And all instances start up
+
+    Then a flowfile with the JSON content '{"field1": "value1", "field2": "value2"}' is placed in the monitored directory in less than 60 seconds
+    And the Minifi logs contain the following message: "key:couchbase.bucket value:test_bucket" in less than 10 seconds
+    And the Minifi logs contain the following message: "key:couchbase.doc.id value:test_doc_id" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.cas value:[1-9][0-9]*" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.expiry value:\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}" in less than 1 seconds
+
+  Scenario: A MiNiFi instance can get data from test bucket with GetCouchbaseKey processor and put the result in an attribute
+    Given a GetFile processor with the "Input Directory" property set to "/tmp/input"
+    And a file with the content '{"field1": "value1", "field2": "value2"}' is present in '/tmp/input'
+    And a PutCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the PutCouchbaseKey processor is set to "test_doc_id"
+    And the "Document Type" property of the PutCouchbaseKey processor is set to "String"
+    And the "Couchbase Cluster Controller Service" property of the PutCouchbaseKey processor is set to "CouchbaseClusterService"
+    And a GetCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the GetCouchbaseKey processor is set to "test_doc_id"
+    And the "Document Type" property of the GetCouchbaseKey processor is set to "String"
+    And the "Couchbase Cluster Controller Service" property of the GetCouchbaseKey processor is set to "CouchbaseClusterService"
+    And the "Put Value to Attribute" property of the GetCouchbaseKey processor is set to "get_couchbase_result"
+    And a PutFile processor with the "Directory" property set to "/tmp/output"
+    And a LogAttribute processor with the "FlowFiles To Log" property set to "0"
+    And a CouchbaseClusterService is setup up with the name "CouchbaseClusterService"
+
+    And the "success" relationship of the GetFile processor is connected to the PutCouchbaseKey
+    And the "success" relationship of the PutCouchbaseKey processor is connected to the GetCouchbaseKey
+    And the "success" relationship of the GetCouchbaseKey processor is connected to the PutFile
+    And the "success" relationship of the PutFile processor is connected to the LogAttribute
+
+    When a Couchbase server is started
+    And all instances start up
+
+    Then a flowfile with the JSON content '{"field1": "value1", "field2": "value2"}' is placed in the monitored directory in less than 60 seconds
+    And the Minifi logs contain the following message: "key:couchbase.bucket value:test_bucket" in less than 10 seconds
+    And the Minifi logs contain the following message: "key:couchbase.doc.id value:test_doc_id" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.cas value:[1-9][0-9]*" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.expiry value:\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2}\.\d{3}" in less than 1 seconds
+    And the Minifi logs contain the following message: 'key:get_couchbase_result value:{"field1": "value1", "field2": "value2"}' in less than 1 seconds
+
+  Scenario: GetCouchbaseKey transfers FlowFile to failure relationship on Couchbase value type mismatch
+    Given a GetFile processor with the "Input Directory" property set to "/tmp/input"
+    And a file with the content '{"field1": "value1", "field2": "value2"}' is present in '/tmp/input'
+    And a PutCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the PutCouchbaseKey processor is set to "test_doc_id"
+    And the "Document Type" property of the PutCouchbaseKey processor is set to "String"
+    And the "Couchbase Cluster Controller Service" property of the PutCouchbaseKey processor is set to "CouchbaseClusterService"
+    And a GetCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the GetCouchbaseKey processor is set to "test_doc_id"
+    And the "Document Type" property of the GetCouchbaseKey processor is set to "Binary"
+    And the "Couchbase Cluster Controller Service" property of the GetCouchbaseKey processor is set to "CouchbaseClusterService"
+    And a CouchbaseClusterService is setup up with the name "CouchbaseClusterService"
+
+    And the "success" relationship of the GetFile processor is connected to the PutCouchbaseKey
+    And the "success" relationship of the PutCouchbaseKey processor is connected to the GetCouchbaseKey
+
+    When a Couchbase server is started
+    And all instances start up
+
+    Then the Minifi logs contain the following message: "Failed to get content for document 'test_doc_id' from collection 'test_bucket._default._default' with the following exception: 'raw_binary_transcoder expects document to have BINARY common flags" in less than 60 seconds
diff --git a/docker/test/integration/minifi/processors/PutCouchbaseKey.py b/docker/test/integration/minifi/processors/GetCouchbaseKey.py
similarity index 84%
copy from docker/test/integration/minifi/processors/PutCouchbaseKey.py
copy to docker/test/integration/minifi/processors/GetCouchbaseKey.py
index 5e94aaa07..0b48dcbdd 100644
--- a/docker/test/integration/minifi/processors/PutCouchbaseKey.py
+++ b/docker/test/integration/minifi/processors/GetCouchbaseKey.py
@@ -15,10 +15,10 @@
 from ..core.Processor import Processor
 
 
-class PutCouchbaseKey(Processor):
+class GetCouchbaseKey(Processor):
     def __init__(self, context, schedule={'scheduling strategy': 'EVENT_DRIVEN'}):
-        super(PutCouchbaseKey, self).__init__(
+        super(GetCouchbaseKey, self).__init__(
             context=context,
-            clazz='PutCouchbaseKey',
-            auto_terminate=['success', 'failure'],
+            clazz='GetCouchbaseKey',
+            auto_terminate=['success', 'failure', 'retry'],
             schedule=schedule)
diff --git a/docker/test/integration/minifi/processors/PutCouchbaseKey.py b/docker/test/integration/minifi/processors/PutCouchbaseKey.py
index 5e94aaa07..341338771 100644
--- a/docker/test/integration/minifi/processors/PutCouchbaseKey.py
+++ b/docker/test/integration/minifi/processors/PutCouchbaseKey.py
@@ -20,5 +20,5 @@ class PutCouchbaseKey(Processor):
         super(PutCouchbaseKey, self).__init__(
             context=context,
             clazz='PutCouchbaseKey',
-            auto_terminate=['success', 'failure'],
+            auto_terminate=['success', 'failure', 'retry'],
             schedule=schedule)
diff --git a/extensions/couchbase/controllerservices/CouchbaseClusterService.cpp b/extensions/couchbase/controllerservices/CouchbaseClusterService.cpp
index 5207657f2..c40697cf7 100644
--- a/extensions/couchbase/controllerservices/CouchbaseClusterService.cpp
+++ b/extensions/couchbase/controllerservices/CouchbaseClusterService.cpp
@@ -17,11 +17,12 @@
  */
 
 #include "CouchbaseClusterService.h"
-#include "couchbase/codec/raw_binary_transcoder.hxx"
-#include "couchbase/codec/raw_string_transcoder.hxx"
-#include "couchbase/codec/raw_json_transcoder.hxx"
 
 #include "core/Resource.h"
+#include "couchbase/codec/raw_binary_transcoder.hxx"
+#include "couchbase/codec/raw_json_transcoder.hxx"
+#include "couchbase/codec/raw_string_transcoder.hxx"
+#include "utils/TimeUtil.h"
 
 namespace org::apache::nifi::minifi::couchbase {
 
@@ -58,8 +59,8 @@ nonstd::expected<::couchbase::collection, CouchbaseErrorType> CouchbaseClient::g
   return cluster_->bucket(collection.bucket_name).scope(collection.scope_name).collection(collection.collection_name);
 }
 
-nonstd::expected<CouchbaseUpsertResult, CouchbaseErrorType> CouchbaseClient::upsert(const CouchbaseCollection& collection,
-    CouchbaseValueType document_type, const std::string& document_id, const std::vector<std::byte>& buffer, const ::couchbase::upsert_options& options) {
+nonstd::expected<CouchbaseUpsertResult, CouchbaseErrorType> CouchbaseClient::upsert(
+    const CouchbaseCollection& collection, CouchbaseValueType document_type, const std::string& document_id, const std::vector<std::byte>& buffer, const ::couchbase::upsert_options& options) {
   auto collection_result = getCollection(collection);
   if (!collection_result.has_value()) {
     return nonstd::make_unexpected(collection_result.error());
@@ -78,27 +79,68 @@ nonstd::expected<CouchbaseUpsertResult, CouchbaseErrorType> CouchbaseClient::ups
   if (upsert_err.ec()) {
     // ambiguous_timeout should not be retried as we do not know if the insert was successful or not
     if (getErrorType(upsert_err.ec()) == CouchbaseErrorType::TEMPORARY && upsert_err.ec().value() != static_cast<int>(::couchbase::errc::common::ambiguous_timeout)) {
-      logger_->log_error("Failed to upsert document '{}' to collection '{}.{}.{}' due to temporary issue, error code: '{}', message: '{}'",
-        document_id, collection.bucket_name, collection.scope_name, collection.collection_name, upsert_err.ec(), upsert_err.message());
+      logger_->log_error("Failed to upsert document '{}' to collection '{}.{}.{}' due to temporary issue, error code: '{}', message: '{}'", document_id, collection.bucket_name, collection.scope_name,
+          collection.collection_name, upsert_err.ec(), upsert_err.message());
       return nonstd::make_unexpected(CouchbaseErrorType::TEMPORARY);
     }
-    logger_->log_error("Failed to upsert document '{}' to collection '{}.{}.{}' with error code: '{}', message: '{}'",
-      document_id, collection.bucket_name, collection.scope_name, collection.collection_name, upsert_err.ec(), upsert_err.message());
+    logger_->log_error("Failed to upsert document '{}' to collection '{}.{}.{}' with error code: '{}', message: '{}'", document_id, collection.bucket_name, collection.scope_name,
+        collection.collection_name, upsert_err.ec(), upsert_err.message());
     return nonstd::make_unexpected(CouchbaseErrorType::FATAL);
   } else {
-    const uint64_t partition_uuid = (upsert_resp.mutation_token().has_value() ? upsert_resp.mutation_token()->partition_uuid() : 0);
-    const uint64_t sequence_number = (upsert_resp.mutation_token().has_value() ? upsert_resp.mutation_token()->sequence_number() : 0);
-    const uint16_t partition_id = (upsert_resp.mutation_token().has_value() ? upsert_resp.mutation_token()->partition_id() : 0);
     return CouchbaseUpsertResult {
-      collection.bucket_name,
-      upsert_resp.cas().value(),
-      partition_uuid,
-      sequence_number,
-      partition_id
+      {
+        collection.bucket_name,
+        upsert_resp.cas().value(),
+      },
+      (upsert_resp.mutation_token().has_value() ? upsert_resp.mutation_token()->sequence_number() : 0),
+      (upsert_resp.mutation_token().has_value() ? upsert_resp.mutation_token()->partition_uuid() : 0),
+      gsl::narrow<uint16_t>(upsert_resp.mutation_token().has_value() ? upsert_resp.mutation_token()->partition_id() : 0)
     };
   }
 }
 
+nonstd::expected<CouchbaseGetResult, CouchbaseErrorType> CouchbaseClient::get(const CouchbaseCollection& collection, const std::string& document_id, CouchbaseValueType return_type) {
+  auto collection_result = getCollection(collection);
+  if (!collection_result.has_value()) {
+    return nonstd::make_unexpected(collection_result.error());
+  }
+
+  ::couchbase::get_options options;
+  options.with_expiry(true);
+  auto [get_err, resp] = collection_result->get(document_id, options).get();
+  if (get_err.ec()) {
+    if (getErrorType(get_err.ec()) == CouchbaseErrorType::TEMPORARY) {
+      logger_->log_error("Failed to get document '{}' from collection '{}.{}.{}' due to timeout", document_id, collection.bucket_name, collection.scope_name, collection.collection_name);
+      return nonstd::make_unexpected(CouchbaseErrorType::TEMPORARY);
+    }
+    std::string cause = get_err.cause() ? get_err.cause()->message() : "";
+    logger_->log_error("Failed to get document '{}' from collection '{}.{}.{}' with error code: '{}', message: '{}'", document_id, collection.bucket_name, collection.scope_name,
+        collection.collection_name, get_err.ec(), get_err.message());
+    return nonstd::make_unexpected(CouchbaseErrorType::FATAL);
+  } else {
+    try {
+      CouchbaseGetResult result;
+      result.bucket_name = collection.bucket_name;
+      result.cas = resp.cas().value();
+      if (return_type == CouchbaseValueType::Json) {
+        result.value = resp.content_as<::couchbase::codec::binary, ::couchbase::codec::raw_json_transcoder>();
+      } else if (return_type == CouchbaseValueType::String) {
+        result.value = resp.content_as<::couchbase::codec::raw_string_transcoder>();
+      } else {
+        result.value = resp.content_as<::couchbase::codec::raw_binary_transcoder>();
+      }
+      if (resp.expiry_time().has_value()) {
+        result.expiry = utils::timeutils::getTimeStr(*resp.expiry_time());
+      }
+      return result;
+    } catch (const std::exception& ex) {
+      logger_->log_error("Failed to get content for document '{}' from collection '{}.{}.{}' with the following exception: '{}'", document_id, collection.bucket_name, collection.scope_name,
+          collection.collection_name, ex.what());
+      return nonstd::make_unexpected(CouchbaseErrorType::FATAL);
+    }
+  }
+}
+
 void CouchbaseClient::close() {
   std::lock_guard<std::mutex> lock(cluster_mutex_);
   if (cluster_) {
diff --git a/extensions/couchbase/controllerservices/CouchbaseClusterService.h b/extensions/couchbase/controllerservices/CouchbaseClusterService.h
index b848b741d..28c6390dd 100644
--- a/extensions/couchbase/controllerservices/CouchbaseClusterService.h
+++ b/extensions/couchbase/controllerservices/CouchbaseClusterService.h
@@ -22,6 +22,7 @@
 #include <string>
 #include <utility>
 #include <mutex>
+#include <variant>
 
 #include "core/controller/ControllerService.h"
 #include "core/PropertyDefinition.h"
@@ -39,9 +40,17 @@ struct CouchbaseCollection {
   std::string collection_name;
 };
 
-struct CouchbaseUpsertResult {
+struct CouchbaseCallResult {
   std::string bucket_name;
   std::uint64_t cas{0};
+};
+
+struct CouchbaseGetResult : public CouchbaseCallResult {
+  std::string expiry;
+  std::variant<std::vector<std::byte>, std::string> value;
+};
+
+struct CouchbaseUpsertResult : public CouchbaseCallResult {
   std::uint64_t sequence_number{0};
   std::uint64_t partition_uuid{0};
   std::uint16_t partition_id{0};
@@ -75,6 +84,7 @@ class CouchbaseClient {
 
   nonstd::expected<CouchbaseUpsertResult, CouchbaseErrorType> upsert(const CouchbaseCollection& collection, CouchbaseValueType document_type, const std::string& document_id,
     const std::vector<std::byte>& buffer, const ::couchbase::upsert_options& options);
+  nonstd::expected<CouchbaseGetResult, CouchbaseErrorType> get(const CouchbaseCollection& collection, const std::string& document_id, CouchbaseValueType return_type);
   nonstd::expected<void, CouchbaseErrorType> establishConnection();
   void close();
 
@@ -151,6 +161,11 @@ class CouchbaseClusterService : public core::controller::ControllerService {
     return client_->upsert(collection, document_type, document_id, buffer, options);
   }
 
+  virtual nonstd::expected<CouchbaseGetResult, CouchbaseErrorType> get(const CouchbaseCollection& collection, const std::string& document_id, CouchbaseValueType return_type) {
+    gsl_Expects(client_);
+    return client_->get(collection, document_id, return_type);
+  }
+
   static gsl::not_null<std::shared_ptr<CouchbaseClusterService>> getFromProperty(const core::ProcessContext& context, const core::PropertyReference& property);
 
  private:
diff --git a/extensions/couchbase/processors/GetCouchbaseKey.cpp b/extensions/couchbase/processors/GetCouchbaseKey.cpp
new file mode 100644
index 000000000..89cf160f6
--- /dev/null
+++ b/extensions/couchbase/processors/GetCouchbaseKey.cpp
@@ -0,0 +1,111 @@
+/**
+ *
+ * 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.
+ */
+
+#include "GetCouchbaseKey.h"
+#include "utils/gsl.h"
+#include "core/Resource.h"
+#include "utils/ProcessorConfigUtils.h"
+
+namespace org::apache::nifi::minifi::couchbase::processors {
+
+void GetCouchbaseKey::onSchedule(core::ProcessContext& context, core::ProcessSessionFactory&) {
+  couchbase_cluster_service_ = controllers::CouchbaseClusterService::getFromProperty(context, GetCouchbaseKey::CouchbaseClusterControllerService);
+  document_type_ = utils::parseEnumProperty<CouchbaseValueType>(context, GetCouchbaseKey::DocumentType);
+}
+
+void GetCouchbaseKey::onTrigger(core::ProcessContext& context, core::ProcessSession& session) {
+  gsl_Expects(couchbase_cluster_service_);
+
+  auto flow_file = session.get();
+  if (!flow_file) {
+    context.yield();
+    return;
+  }
+
+  CouchbaseCollection collection;
+  if (!context.getProperty(BucketName, collection.bucket_name, flow_file.get()) || collection.bucket_name.empty()) {
+    logger_->log_error("Bucket '{}' is invalid or empty!", collection.bucket_name);
+    session.transfer(flow_file, Failure);
+    return;
+  }
+
+  if (!context.getProperty(ScopeName, collection.scope_name, flow_file.get()) || collection.scope_name.empty()) {
+    collection.scope_name = ::couchbase::scope::default_name;
+  }
+
+  if (!context.getProperty(CollectionName, collection.collection_name, flow_file.get()) || collection.collection_name.empty()) {
+    collection.collection_name = ::couchbase::collection::default_name;
+  }
+
+  std::string document_id;
+  if (!context.getProperty(DocumentId, document_id, flow_file.get()) || document_id.empty()) {
+    auto ff_content = session.readBuffer(flow_file).buffer;
+    document_id = std::string(reinterpret_cast<const char*>(ff_content.data()), ff_content.size());
+  }
+
+  if (document_id.empty()) {
+    logger_->log_error("Document ID is empty, transferring FlowFile to failure relationship");
+    session.transfer(flow_file, Failure);
+    return;
+  }
+
+  std::string attribute_to_put_result_to;
+  context.getProperty(PutValueToAttribute, attribute_to_put_result_to, flow_file.get());
+
+  if (auto get_result = couchbase_cluster_service_->get(collection, document_id, document_type_)) {
+    if (!attribute_to_put_result_to.empty()) {
+      if (document_type_ == CouchbaseValueType::String) {
+        session.putAttribute(*flow_file, attribute_to_put_result_to, std::get<std::string>(get_result->value));
+      } else {
+        auto& binary_data = std::get<std::vector<std::byte>>(get_result->value);
+        std::string str_value{reinterpret_cast<const char*>(binary_data.data()), binary_data.size()};
+        session.putAttribute(*flow_file, attribute_to_put_result_to, str_value);
+      }
+    } else {
+      session.write(flow_file, [&, this](const std::shared_ptr<io::OutputStream>& stream) -> int64_t {
+        if (document_type_ == CouchbaseValueType::String) {
+          auto& value = std::get<std::string>(get_result->value);
+          stream->write(value);
+          return gsl::narrow<int64_t>(value.size());
+        } else {
+          auto& value = std::get<std::vector<std::byte>>(get_result->value);
+          stream->write(value);
+          return gsl::narrow<int64_t>(value.size());
+        }
+      });
+    }
+
+    session.putAttribute(*flow_file, "couchbase.bucket", get_result->bucket_name);
+    session.putAttribute(*flow_file, "couchbase.doc.id", document_id);
+    session.putAttribute(*flow_file, "couchbase.doc.cas", std::to_string(get_result->cas));
+    session.putAttribute(*flow_file, "couchbase.doc.expiry", get_result->expiry);
+    session.transfer(flow_file, Success);
+  } else if (get_result.error() == CouchbaseErrorType::TEMPORARY) {
+    logger_->log_error("Failed to get document '{}' from collection '{}.{}.{}' due to timeout, transferring to retry relationship",
+      document_id, collection.bucket_name, collection.scope_name, collection.collection_name);
+    session.transfer(flow_file, Retry);
+  } else {
+    logger_->log_error("Failed to get document '{}' from collection '{}.{}.{}', transferring to failure relationship",
+      document_id, collection.bucket_name, collection.scope_name, collection.collection_name);
+    session.transfer(flow_file, Failure);
+  }
+}
+
+REGISTER_RESOURCE(GetCouchbaseKey, Processor);
+
+}  // namespace org::apache::nifi::minifi::couchbase::processors
diff --git a/extensions/couchbase/processors/PutCouchbaseKey.h b/extensions/couchbase/processors/GetCouchbaseKey.h
similarity index 56%
copy from extensions/couchbase/processors/PutCouchbaseKey.h
copy to extensions/couchbase/processors/GetCouchbaseKey.h
index 2b4f420af..4951c18ef 100644
--- a/extensions/couchbase/processors/PutCouchbaseKey.h
+++ b/extensions/couchbase/processors/GetCouchbaseKey.h
@@ -23,56 +23,18 @@
 
 #include "core/AbstractProcessor.h"
 #include "core/ProcessSession.h"
-#include "utils/Enum.h"
 #include "core/logging/LoggerConfiguration.h"
 #include "CouchbaseClusterService.h"
-#include "couchbase/persist_to.hxx"
-#include "couchbase/replicate_to.hxx"
-
-namespace magic_enum::customize {
-
-template <>
-constexpr customize_t enum_name<::couchbase::persist_to>(::couchbase::persist_to value) noexcept {
-  switch (value) {
-    case ::couchbase::persist_to::none:
-      return "NONE";
-    case ::couchbase::persist_to::active:
-      return "ACTIVE";
-    case ::couchbase::persist_to::one:
-      return "ONE";
-    case ::couchbase::persist_to::two:
-      return "TWO";
-    case ::couchbase::persist_to::three:
-      return "THREE";
-    case ::couchbase::persist_to::four:
-      return "FOUR";
-  }
-  return invalid_tag;
-}
-
-template <>
-constexpr customize_t enum_name<::couchbase::replicate_to>(::couchbase::replicate_to value) noexcept {
-  switch (value) {
-    case ::couchbase::replicate_to::none:
-      return "NONE";
-    case ::couchbase::replicate_to::one:
-      return "ONE";
-    case ::couchbase::replicate_to::two:
-      return "TWO";
-    case ::couchbase::replicate_to::three:
-      return "THREE";
-  }
-  return invalid_tag;
-}
-}  // namespace magic_enum::customize
 
 namespace org::apache::nifi::minifi::couchbase::processors {
 
-class PutCouchbaseKey final : public core::AbstractProcessor<PutCouchbaseKey> {
+class GetCouchbaseKey final : public core::AbstractProcessor<GetCouchbaseKey> {
  public:
-  using core::AbstractProcessor<PutCouchbaseKey>::AbstractProcessor;
+  using core::AbstractProcessor<GetCouchbaseKey>::AbstractProcessor;
 
-  EXTENSIONAPI static constexpr const char* Description = "Put a document to Couchbase Server via Key/Value access.";
+  EXTENSIONAPI static constexpr const char* Description = "Get a document from Couchbase Server via Key/Value access. The ID of the document to fetch may be supplied by setting the "
+    "<Document Id> property. NOTE: if the Document Id property is not set, the contents of the FlowFile will be read to determine the Document Id, which means that the contents of "
+    "the entire FlowFile will be buffered in memory.";
 
   EXTENSIONAPI static constexpr auto CouchbaseClusterControllerService = core::PropertyDefinitionBuilder<>::createProperty("Couchbase Cluster Controller Service")
       .withDescription("A Couchbase Cluster Controller Service which manages connections to a Couchbase cluster.")
@@ -93,28 +55,20 @@ class PutCouchbaseKey final : public core::AbstractProcessor<PutCouchbaseKey> {
       .withDescription("Collection to use inside the bucket scope. If not specified, the _default collection is used.")
       .supportsExpressionLanguage(true)
       .build();
-  EXTENSIONAPI static constexpr auto DocumentType = core::PropertyDefinitionBuilder<magic_enum::enum_count<CouchbaseValueType>()>::createProperty("Document Type")
-      .withDescription("Content type to store data as.")
+  EXTENSIONAPI static constexpr auto DocumentType = core::PropertyDefinitionBuilder<3>::createProperty("Document Type")
+      .withDescription("Content type of the retrieved value.")
       .isRequired(true)
       .withDefaultValue(magic_enum::enum_name(CouchbaseValueType::Json))
       .withAllowedValues(magic_enum::enum_names<CouchbaseValueType>())
       .build();
   EXTENSIONAPI static constexpr auto DocumentId = core::PropertyDefinitionBuilder<>::createProperty("Document Id")
-      .withDescription("A static, fixed Couchbase document id, or an expression to construct the Couchbase document id. "
-                       "If not specified, either the FlowFile uuid attribute or if that's not found a generated uuid will be used.")
+      .withDescription("A static, fixed Couchbase document id, or an expression to construct the Couchbase document id.")
       .supportsExpressionLanguage(true)
       .build();
-  EXTENSIONAPI static constexpr auto PersistTo = core::PropertyDefinitionBuilder<6>::createProperty("Persist To")
-      .withDescription("Durability constraint about disk persistence.")
-      .isRequired(true)
-      .withDefaultValue(magic_enum::enum_name(::couchbase::persist_to::none))
-      .withAllowedValues(magic_enum::enum_names<::couchbase::persist_to>())
-      .build();
-  EXTENSIONAPI static constexpr auto ReplicateTo = core::PropertyDefinitionBuilder<4>::createProperty("Replicate To")
-      .withDescription("Durability constraint about replication.")
-      .isRequired(true)
-      .withDefaultValue(magic_enum::enum_name(::couchbase::replicate_to::none))
-      .withAllowedValues(magic_enum::enum_names<::couchbase::replicate_to>())
+  EXTENSIONAPI static constexpr auto PutValueToAttribute = core::PropertyDefinitionBuilder<>::createProperty("Put Value to Attribute")
+      .withDescription("If set, the retrieved value will be put into an attribute of the FlowFile instead of a the content of the FlowFile. "
+                       "The attribute key to put to is determined by evaluating value of this property.")
+      .supportsExpressionLanguage(true)
       .build();
 
   EXTENSIONAPI static constexpr auto Properties = std::to_array<core::PropertyReference>({
@@ -124,23 +78,23 @@ class PutCouchbaseKey final : public core::AbstractProcessor<PutCouchbaseKey> {
     CollectionName,
     DocumentType,
     DocumentId,
-    PersistTo,
-    ReplicateTo
+    PutValueToAttribute
   });
 
-  EXTENSIONAPI static constexpr auto Success = core::RelationshipDefinition{"success", "All FlowFiles that are written to Couchbase Server are routed to this relationship."};
-  EXTENSIONAPI static constexpr auto Failure = core::RelationshipDefinition{"failure", "All FlowFiles failed to be written to Couchbase Server and not retry-able are routed to this relationship."};
-  EXTENSIONAPI static constexpr auto Retry = core::RelationshipDefinition{"retry", "All FlowFiles failed to be written to Couchbase Server but can be retried are routed to this relationship."};
-  EXTENSIONAPI static constexpr auto Relationships = std::array{Success, Failure, Retry};
+  EXTENSIONAPI static constexpr auto Success = core::RelationshipDefinition{"success",
+      "Values retrieved from Couchbase Server are written as outgoing FlowFiles content or put into an attribute of the incoming FlowFile and routed to this relationship."};
+  EXTENSIONAPI static constexpr auto Failure = core::RelationshipDefinition{"failure", "All FlowFiles failed to fetch from Couchbase Server and not retry-able are routed to this relationship."};
+  EXTENSIONAPI static constexpr auto Retry = core::RelationshipDefinition{"retry", "All FlowFiles failed to fetch from Couchbase Server but can be retried are routed to this relationship."};
+  EXTENSIONAPI static constexpr auto Original = core::RelationshipDefinition{"original",
+      "The original input FlowFile is routed to this relationship when the value is retrieved from Couchbase Server and routed to 'success'."};
+  EXTENSIONAPI static constexpr auto Relationships = std::array{Success, Failure, Retry, Original};
 
   EXTENSIONAPI static constexpr auto CouchbaseBucket = core::OutputAttributeDefinition<>{"couchbase.bucket", {Success}, "Bucket where the document was stored."};
   EXTENSIONAPI static constexpr auto CouchbaseDocId = core::OutputAttributeDefinition<>{"couchbase.doc.id", {Success}, "Id of the document."};
   EXTENSIONAPI static constexpr auto CouchbaseDocCas = core::OutputAttributeDefinition<>{"couchbase.doc.cas", {Success}, "CAS of the document."};
-  EXTENSIONAPI static constexpr auto CouchbaseDocSequenceNumber = core::OutputAttributeDefinition<>{"couchbase.doc.sequence.number", {Success}, "Sequence number associated with the document."};
-  EXTENSIONAPI static constexpr auto CouchbasePartitionUUID = core::OutputAttributeDefinition<>{"couchbase.partition.uuid", {Success}, "UUID of partition."};
-  EXTENSIONAPI static constexpr auto CouchbasePartitionId = core::OutputAttributeDefinition<>{"couchbase.partition.id", {Success}, "ID of partition (also known as vBucket)."};
-  EXTENSIONAPI static constexpr auto OutputAttributes = std::array<core::OutputAttributeReference, 6>{
-      CouchbaseBucket, CouchbaseDocId, CouchbaseDocCas, CouchbaseDocSequenceNumber, CouchbasePartitionUUID, CouchbasePartitionId};
+  EXTENSIONAPI static constexpr auto CouchbaseDocExpiry = core::OutputAttributeDefinition<>{"couchbase.doc.expiry", {Success}, "Expiration of the document."};
+  EXTENSIONAPI static constexpr auto OutputAttributes = std::array<core::OutputAttributeReference, 4>{
+      CouchbaseBucket, CouchbaseDocId, CouchbaseDocCas, CouchbaseDocExpiry};
 
   EXTENSIONAPI static constexpr bool SupportsDynamicProperties = false;
   EXTENSIONAPI static constexpr bool SupportsDynamicRelationships = false;
@@ -152,10 +106,8 @@ class PutCouchbaseKey final : public core::AbstractProcessor<PutCouchbaseKey> {
 
  private:
   std::shared_ptr<controllers::CouchbaseClusterService> couchbase_cluster_service_;
-  std::shared_ptr<core::logging::Logger> logger_ = core::logging::LoggerFactory<PutCouchbaseKey>::getLogger(uuid_);
   CouchbaseValueType document_type_ = CouchbaseValueType::Json;
-  ::couchbase::persist_to persist_to_ = ::couchbase::persist_to::none;
-  ::couchbase::replicate_to replicate_to_ = ::couchbase::replicate_to::none;
+  std::shared_ptr<core::logging::Logger> logger_ = core::logging::LoggerFactory<GetCouchbaseKey>::getLogger(uuid_);
 };
 
 }  // namespace org::apache::nifi::minifi::couchbase::processors
diff --git a/extensions/couchbase/processors/PutCouchbaseKey.h b/extensions/couchbase/processors/PutCouchbaseKey.h
index 2b4f420af..1991488ed 100644
--- a/extensions/couchbase/processors/PutCouchbaseKey.h
+++ b/extensions/couchbase/processors/PutCouchbaseKey.h
@@ -152,10 +152,10 @@ class PutCouchbaseKey final : public core::AbstractProcessor<PutCouchbaseKey> {
 
  private:
   std::shared_ptr<controllers::CouchbaseClusterService> couchbase_cluster_service_;
-  std::shared_ptr<core::logging::Logger> logger_ = core::logging::LoggerFactory<PutCouchbaseKey>::getLogger(uuid_);
   CouchbaseValueType document_type_ = CouchbaseValueType::Json;
   ::couchbase::persist_to persist_to_ = ::couchbase::persist_to::none;
   ::couchbase::replicate_to replicate_to_ = ::couchbase::replicate_to::none;
+  std::shared_ptr<core::logging::Logger> logger_ = core::logging::LoggerFactory<PutCouchbaseKey>::getLogger(uuid_);
 };
 
 }  // namespace org::apache::nifi::minifi::couchbase::processors
diff --git a/extensions/couchbase/tests/GetCouchbaseKeyTests.cpp b/extensions/couchbase/tests/GetCouchbaseKeyTests.cpp
new file mode 100644
index 000000000..0d2e5b910
--- /dev/null
+++ b/extensions/couchbase/tests/GetCouchbaseKeyTests.cpp
@@ -0,0 +1,170 @@
+/**
+ *
+ * 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.
+ */
+
+#include "unit/TestBase.h"
+#include "unit/Catch.h"
+#include "unit/SingleProcessorTestController.h"
+#include "processors/GetCouchbaseKey.h"
+#include "MockCouchbaseClusterService.h"
+#include "core/Resource.h"
+
+namespace org::apache::nifi::minifi::couchbase::test {
+
+REGISTER_RESOURCE(MockCouchbaseClusterService, ControllerService);
+
+struct ExpectedCallOptions {
+  std::string bucket_name;
+  std::string scope_name;
+  std::string collection_name;
+  std::string doc_id;
+  couchbase::CouchbaseValueType document_type;
+};
+
+class GetCouchbaseKeyTestController : public TestController {
+ public:
+  GetCouchbaseKeyTestController()
+      : controller_(std::make_unique<processors::GetCouchbaseKey>("GetCouchbaseKey")),
+        proc_(controller_.getProcessor()) {
+    LogTestController::getInstance().setDebug<TestPlan>();
+    LogTestController::getInstance().setDebug<minifi::core::Processor>();
+    LogTestController::getInstance().setTrace<minifi::core::ProcessSession>();
+    LogTestController::getInstance().setDebug<controllers::CouchbaseClusterService>();
+    LogTestController::getInstance().setDebug<processors::GetCouchbaseKey>();
+    auto controller_service_node = controller_.plan->addController("MockCouchbaseClusterService", "MockCouchbaseClusterService");
+    mock_couchbase_cluster_service_ = std::static_pointer_cast<MockCouchbaseClusterService>(controller_service_node->getControllerServiceImplementation());
+    proc_->setProperty(processors::GetCouchbaseKey::CouchbaseClusterControllerService, "MockCouchbaseClusterService");
+  }
+
+  void verifyResults(const minifi::test::ProcessorTriggerResult& results, const minifi::core::Relationship& expected_result, const ExpectedCallOptions& expected_call_options,
+      const std::string& input) const {
+    std::shared_ptr<core::FlowFile> flow_file;
+    if (expected_result == processors::GetCouchbaseKey::Success) {
+      REQUIRE(results.at(processors::GetCouchbaseKey::Success).size() == 1);
+      REQUIRE(results.at(processors::GetCouchbaseKey::Failure).empty());
+      REQUIRE(results.at(processors::GetCouchbaseKey::Retry).empty());
+      flow_file = results.at(processors::GetCouchbaseKey::Success)[0];
+    } else if (expected_result == processors::GetCouchbaseKey::Failure) {
+      REQUIRE(results.at(processors::GetCouchbaseKey::Success).empty());
+      REQUIRE(results.at(processors::GetCouchbaseKey::Failure).size() == 1);
+      REQUIRE(results.at(processors::GetCouchbaseKey::Retry).empty());
+      flow_file = results.at(processors::GetCouchbaseKey::Failure)[0];
+      REQUIRE(LogTestController::getInstance().contains("Failed to get document", 1s));
+    } else {
+      REQUIRE(results.at(processors::GetCouchbaseKey::Success).empty());
+      REQUIRE(results.at(processors::GetCouchbaseKey::Failure).empty());
+      REQUIRE(results.at(processors::GetCouchbaseKey::Retry).size() == 1);
+      flow_file = results.at(processors::GetCouchbaseKey::Retry)[0];
+    }
+
+    auto get_collection_parameters = mock_couchbase_cluster_service_->getCollectionParameter();
+    CHECK(get_collection_parameters.bucket_name == expected_call_options.bucket_name);
+    CHECK(get_collection_parameters.collection_name == expected_call_options.collection_name);
+    CHECK(get_collection_parameters.scope_name == expected_call_options.scope_name);
+
+    auto get_parameters = mock_couchbase_cluster_service_->getGetParameters();
+    CHECK(get_parameters.document_id == expected_call_options.doc_id);
+    CHECK(get_parameters.document_type == expected_call_options.document_type);
+
+    if (expected_result != processors::GetCouchbaseKey::Success) {
+      return;
+    }
+
+    CHECK(flow_file->getAttribute("couchbase.bucket").value() == expected_call_options.bucket_name);
+    CHECK(flow_file->getAttribute("couchbase.doc.id").value() == expected_call_options.doc_id);
+    CHECK(flow_file->getAttribute("couchbase.doc.cas").value() == std::to_string(COUCHBASE_GET_RESULT_CAS));
+    CHECK(flow_file->getAttribute("couchbase.doc.expiry").value() == COUCHBASE_GET_RESULT_EXPIRY);
+    std::string value;
+    proc_->getProperty(processors::GetCouchbaseKey::PutValueToAttribute, value);
+    if (!value.empty()) {
+      CHECK(flow_file->getAttribute(value).value() == COUCHBASE_GET_RESULT_CONTENT);
+      CHECK(controller_.plan->getContent(flow_file) == input);
+    } else {
+      CHECK(controller_.plan->getContent(flow_file) == COUCHBASE_GET_RESULT_CONTENT);
+    }
+  }
+
+ protected:
+  minifi::test::SingleProcessorTestController controller_;
+  core::Processor* proc_ = nullptr;
+  std::shared_ptr<MockCouchbaseClusterService> mock_couchbase_cluster_service_;
+};
+
+TEST_CASE_METHOD(GetCouchbaseKeyTestController, "Invalid Couchbase cluster controller service", "[getcouchbasekey]") {
+  proc_->setProperty(processors::GetCouchbaseKey::CouchbaseClusterControllerService, "invalid");
+  REQUIRE_THROWS_AS(controller_.trigger({minifi::test::InputFlowFileData{"couchbase_id"}}), minifi::Exception);
+}
+
+TEST_CASE_METHOD(GetCouchbaseKeyTestController, "Invalid bucket name", "[getcouchbasekey]") {
+  proc_->setProperty(processors::GetCouchbaseKey::BucketName, "");
+  auto results = controller_.trigger({minifi::test::InputFlowFileData{"couchbase_id"}});
+  REQUIRE(results[processors::GetCouchbaseKey::Failure].size() == 1);
+  REQUIRE(LogTestController::getInstance().contains("Bucket '' is invalid or empty!", 1s));
+}
+
+TEST_CASE_METHOD(GetCouchbaseKeyTestController, "Document ID is empty and no content is present to use", "[getcouchbasekey]") {
+  proc_->setProperty(processors::GetCouchbaseKey::BucketName, "mybucket");
+  auto results = controller_.trigger({minifi::test::InputFlowFileData{""}});
+  REQUIRE(results.at(processors::GetCouchbaseKey::Success).empty());
+  REQUIRE(results.at(processors::GetCouchbaseKey::Failure).size() == 1);
+  REQUIRE(results.at(processors::GetCouchbaseKey::Retry).empty());
+  REQUIRE(LogTestController::getInstance().contains("Document ID is empty, transferring FlowFile to failure relationship", 1s));
+}
+
+TEST_CASE_METHOD(GetCouchbaseKeyTestController, "Get succeeeds with default properties", "[getcouchbasekey]") {
+  proc_->setProperty(processors::GetCouchbaseKey::BucketName, "mybucket");
+  const std::string input = "couchbase_id";
+  auto results = controller_.trigger({minifi::test::InputFlowFileData{input}});
+  verifyResults(results, processors::GetCouchbaseKey::Success, ExpectedCallOptions{"mybucket", "_default", "_default", input, couchbase::CouchbaseValueType::Json}, input);
+}
+
+TEST_CASE_METHOD(GetCouchbaseKeyTestController, "Get succeeeds with optional properties", "[getcouchbasekey]") {
+  proc_->setProperty(processors::GetCouchbaseKey::BucketName, "mybucket");
+  proc_->setProperty(processors::GetCouchbaseKey::ScopeName, "scope1");
+  proc_->setProperty(processors::GetCouchbaseKey::CollectionName, "collection1");
+  proc_->setProperty(processors::GetCouchbaseKey::DocumentId, "important_doc");
+  proc_->setProperty(processors::GetCouchbaseKey::DocumentType, "Binary");
+  auto results = controller_.trigger({minifi::test::InputFlowFileData{""}});
+  verifyResults(results, processors::GetCouchbaseKey::Success, ExpectedCallOptions{"mybucket", "scope1", "collection1", "important_doc", couchbase::CouchbaseValueType::Binary}, "");
+}
+
+TEST_CASE_METHOD(GetCouchbaseKeyTestController, "Get fails with default properties", "[getcouchbasekey]") {
+  proc_->setProperty(processors::GetCouchbaseKey::BucketName, "mybucket");
+  mock_couchbase_cluster_service_->setGetError(CouchbaseErrorType::FATAL);
+  const std::string input = "couchbase_id";
+  auto results = controller_.trigger({minifi::test::InputFlowFileData{input}});
+  verifyResults(results, processors::GetCouchbaseKey::Failure, ExpectedCallOptions{"mybucket", "_default", "_default", input, couchbase::CouchbaseValueType::Json}, input);
+}
+
+TEST_CASE_METHOD(GetCouchbaseKeyTestController, "FlowFile is transferred to retry relationship when temporary error is returned", "[getcouchbasekey]") {
+  proc_->setProperty(processors::GetCouchbaseKey::BucketName, "mybucket");
+  mock_couchbase_cluster_service_->setGetError(CouchbaseErrorType::TEMPORARY);
+  const std::string input = "couchbase_id";
+  auto results = controller_.trigger({minifi::test::InputFlowFileData{input}});
+  verifyResults(results, processors::GetCouchbaseKey::Retry, ExpectedCallOptions{"mybucket", "_default", "_default", input, couchbase::CouchbaseValueType::Json}, input);
+}
+
+TEST_CASE_METHOD(GetCouchbaseKeyTestController, "Get result is written to attribute", "[getcouchbasekey]") {
+  proc_->setProperty(processors::GetCouchbaseKey::BucketName, "mybucket");
+  proc_->setProperty(processors::GetCouchbaseKey::DocumentType, "String");
+  proc_->setProperty(processors::GetCouchbaseKey::PutValueToAttribute, "myattribute");
+  const std::string input = "couchbase_id";
+  auto results = controller_.trigger({minifi::test::InputFlowFileData{input}});
+  verifyResults(results, processors::GetCouchbaseKey::Success, ExpectedCallOptions{"mybucket", "_default", "_default", input, couchbase::CouchbaseValueType::String}, input);
+}
+
+}  // namespace org::apache::nifi::minifi::couchbase::test
diff --git a/extensions/couchbase/tests/MockCouchbaseClusterService.h b/extensions/couchbase/tests/MockCouchbaseClusterService.h
index a2757f16c..6566e85d4 100644
--- a/extensions/couchbase/tests/MockCouchbaseClusterService.h
+++ b/extensions/couchbase/tests/MockCouchbaseClusterService.h
@@ -29,6 +29,9 @@ const std::uint64_t COUCHBASE_PUT_RESULT_CAS = 9876;
 const std::uint64_t COUCHBASE_PUT_RESULT_SEQUENCE_NUMBER = 345;
 const std::uint64_t COUCHBASE_PUT_RESULT_PARTITION_UUID = 7890123456;
 const std::uint16_t COUCHBASE_PUT_RESULT_PARTITION_ID = 1234;
+const std::string COUCHBASE_GET_RESULT_EXPIRY = "2024/10/14 09:37:43.000Z";
+const std::string COUCHBASE_GET_RESULT_CONTENT = "abc";
+const uint64_t COUCHBASE_GET_RESULT_CAS = 1234567;
 
 struct UpsertParameters {
   CouchbaseValueType document_type;
@@ -36,6 +39,10 @@ struct UpsertParameters {
   std::vector<std::byte> buffer;
   ::couchbase::upsert_options options;
 };
+struct GetParameters {
+  std::string document_id;
+  CouchbaseValueType document_type;
+};
 
 class MockCouchbaseClusterService : public controllers::CouchbaseClusterService {
  public:
@@ -57,7 +64,23 @@ class MockCouchbaseClusterService : public controllers::CouchbaseClusterService
     if (upsert_error_) {
       return nonstd::make_unexpected(*upsert_error_);
     } else {
-      return CouchbaseUpsertResult{collection_.bucket_name, COUCHBASE_PUT_RESULT_CAS, COUCHBASE_PUT_RESULT_SEQUENCE_NUMBER, COUCHBASE_PUT_RESULT_PARTITION_UUID, COUCHBASE_PUT_RESULT_PARTITION_ID};
+      return CouchbaseUpsertResult{{collection_.bucket_name, COUCHBASE_PUT_RESULT_CAS}, COUCHBASE_PUT_RESULT_SEQUENCE_NUMBER, COUCHBASE_PUT_RESULT_PARTITION_UUID, COUCHBASE_PUT_RESULT_PARTITION_ID};
+    }
+  }
+
+  nonstd::expected<CouchbaseGetResult, CouchbaseErrorType> get(const CouchbaseCollection& collection, const std::string& document_id, CouchbaseValueType document_type) override {
+    collection_ = collection;
+    get_parameters_.document_id = document_id;
+    get_parameters_.document_type = document_type;
+
+    if (get_error_) {
+      return nonstd::make_unexpected(*get_error_);
+    } else {
+      if (document_type == CouchbaseValueType::String) {
+        return CouchbaseGetResult{{collection_.bucket_name, COUCHBASE_GET_RESULT_CAS}, COUCHBASE_GET_RESULT_EXPIRY, COUCHBASE_GET_RESULT_CONTENT};
+      }
+      return CouchbaseGetResult{{collection_.bucket_name, COUCHBASE_GET_RESULT_CAS}, COUCHBASE_GET_RESULT_EXPIRY,
+        std::vector<std::byte>{static_cast<std::byte>('a'), static_cast<std::byte>('b'), static_cast<std::byte>('c')}};
     }
   }
 
@@ -65,6 +88,10 @@ class MockCouchbaseClusterService : public controllers::CouchbaseClusterService
     return upsert_parameters_;
   }
 
+  GetParameters getGetParameters() const {
+    return get_parameters_;
+  }
+
   CouchbaseCollection getCollectionParameter() const {
     return collection_;
   }
@@ -73,9 +100,15 @@ class MockCouchbaseClusterService : public controllers::CouchbaseClusterService
     upsert_error_ = upsert_error;
   }
 
+  void setGetError(const CouchbaseErrorType get_error) {
+    get_error_ = get_error;
+  }
+
  private:
   CouchbaseCollection collection_;
   UpsertParameters upsert_parameters_;
+  GetParameters get_parameters_;
   std::optional<CouchbaseErrorType> upsert_error_;
+  std::optional<CouchbaseErrorType> get_error_;
 };
 }  // namespace org::apache::nifi::minifi::couchbase::test
diff --git a/libminifi/include/core/Processor.h b/libminifi/include/core/Processor.h
index f720733e8..6f25c176c 100644
--- a/libminifi/include/core/Processor.h
+++ b/libminifi/include/core/Processor.h
@@ -238,6 +238,8 @@ class Processor : public Connectable, public ConfigurableComponent, public state
   std::string cron_period_;
   gsl::not_null<std::shared_ptr<ProcessorMetrics>> metrics_;
 
+  std::shared_ptr<logging::Logger> logger_;
+
  private:
   mutable std::mutex mutex_;
   std::atomic<std::chrono::steady_clock::time_point> yield_expiration_{};
@@ -254,8 +256,6 @@ class Processor : public Connectable, public ConfigurableComponent, public state
 
   // an outgoing connection allows us to reach these nodes
   std::unordered_map<Connection*, std::unordered_set<Processor*>> reachable_processors_;
-
-  std::shared_ptr<logging::Logger> logger_;
 };
 
 }  // namespace core


(nifi-minifi-cpp) 01/04: MINIFICPP-2467 PutCouchbaseKey processor and controller

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

szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit bd1182eb8cc6121a958d28db41ab27d24d6f54bc
Author: Gabor Gyimesi <ga...@gmail.com>
AuthorDate: Wed Nov 27 12:24:10 2024 +0100

    MINIFICPP-2467 PutCouchbaseKey processor and controller
    
    MINIFICPP-2468
    
    Introduces Couchbase extension with support for inserting data to Couchbase DB using PutCouchbaseKey processor using username/password authentication through CouchbaseClusterService controller service.
    
    This PR also upgrades the following thirdparty libraries:
    - Spdlog 1.12.0 -> 1.14.1
    - Fmt 10.1.0 -> 11.0.2
    
    Closes #1875
    
    Signed-off-by: Marton Szasz <sz...@apache.org>
---
 .github/workflows/ci.yml                           |   6 +-
 .github/workflows/verify-package.yml               |   2 +-
 CONTROLLERS.md                                     |  18 +++
 LICENSE                                            | 154 +++++++++++++++++-
 NOTICE                                             |   3 +
 PROCESSORS.md                                      |  42 +++++
 README.md                                          |   1 +
 Windows.md                                         |   2 +-
 bootstrap.sh                                       |   2 +
 bstrp_functions.sh                                 |   2 +
 cmake/Asio.cmake                                   |   2 +-
 cmake/Bustache.cmake                               |   7 +
 cmake/Couchbase.cmake                              |  45 ++++++
 cmake/DockerConfig.cmake                           |   1 +
 cmake/MiNiFiOptions.cmake                          |   1 +
 cmake/Spdlog.cmake                                 |   4 +-
 cmake/fmt.cmake                                    |   4 +-
 docker/requirements.txt                            |   1 +
 docker/test/integration/cluster/ContainerStore.py  |  13 ++
 .../test/integration/cluster/DockerTestCluster.py  |  12 +-
 .../cluster/checkers/CouchbaseChecker.py           |  69 +++++++++
 .../integration/cluster/containers/Container.py    |   4 +
 .../cluster/containers/CouchbaseServerContainer.py |  55 +++++++
 .../features/MiNiFi_integration_test_driver.py     |  24 ++-
 docker/test/integration/features/couchbase.feature |  67 ++++++++
 docker/test/integration/features/steps/steps.py    |  21 +++
 .../minifi/controllers/CouchbaseClusterService.py  |  27 ++++
 .../minifi/processors/PutCouchbaseKey.py           |  24 +++
 .../couchbase/CMakeLists.txt                       |  29 ++--
 .../controllerservices/CouchbaseClusterService.cpp | 168 ++++++++++++++++++++
 .../controllerservices/CouchbaseClusterService.h   | 162 +++++++++++++++++++
 .../couchbase/processors/PutCouchbaseKey.cpp       |  86 +++++++++++
 extensions/couchbase/processors/PutCouchbaseKey.h  | 161 +++++++++++++++++++
 extensions/couchbase/tests/CMakeLists.txt          |  39 +++++
 .../couchbase/tests/MockCouchbaseClusterService.h  |  81 ++++++++++
 .../couchbase/tests/PutCouchbaseKeyTests.cpp       | 172 +++++++++++++++++++++
 libminifi/include/Exception.h                      |   2 +-
 libminifi/include/utils/SmallString.h              |   2 +-
 thirdparty/bustache/add-append.patch               |  18 +++
 thirdparty/couchbase/remove-thirdparty.patch       | 172 +++++++++++++++++++++
 win_build_vs.bat                                   |   4 +-
 41 files changed, 1675 insertions(+), 34 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 37921919c..9ec816029 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -3,7 +3,7 @@ on: [push, pull_request, workflow_dispatch]
 env:
   DOCKER_CMAKE_FLAGS: -DDOCKER_VERIFY_THREAD=3 -DUSE_SHARED_LIBS= -DSTRICT_GSL_CHECKS=AUDIT -DCI_BUILD=ON -DENABLE_AWS=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_MQTT=ON -DENABLE_AZURE=ON -DENABLE_SQL=ON \
     -DENABLE_SPLUNK=ON -DENABLE_GCP=ON -DENABLE_OPC=ON -DENABLE_PYTHON_SCRIPTING=ON -DENABLE_LUA_SCRIPTING=ON -DENABLE_KUBERNETES=ON -DENABLE_TEST_PROCESSORS=ON -DENABLE_PROMETHEUS=ON \
-    -DENABLE_ELASTICSEARCH=ON -DENABLE_GRAFANA_LOKI=ON -DDOCKER_BUILD_ONLY=ON
+    -DENABLE_ELASTICSEARCH=ON -DENABLE_GRAFANA_LOKI=ON -DENABLE_COUCHBASE=ON -DDOCKER_BUILD_ONLY=ON
   SCCACHE_GHA_ENABLE: true
   CCACHE_DIR: ${{ GITHUB.WORKSPACE }}/.ccache
 jobs:
@@ -26,6 +26,7 @@ jobs:
         -DENABLE_BZIP2=ON
         -DENABLE_CIVET=ON
         -DENABLE_CONTROLLER=ON
+        -DENABLE_COUCHBASE=ON
         -DENABLE_ELASTICSEARCH=ON
         -DENABLE_ENCRYPT_CONFIG=ON
         -DENABLE_EXPRESSION_LANGUAGE=ON
@@ -131,6 +132,7 @@ jobs:
         -DENABLE_BZIP2=ON
         -DENABLE_CIVET=ON
         -DENABLE_CONTROLLER=ON
+        -DENABLE_COUCHBASE=ON
         -DENABLE_COVERAGE=
         -DENABLE_ELASTICSEARCH=ON
         -DENABLE_ENCRYPT_CONFIG=ON
@@ -245,6 +247,7 @@ jobs:
         -DENABLE_BZIP2=ON
         -DENABLE_CIVET=ON
         -DENABLE_CONTROLLER=ON
+        -DENABLE_COUCHBASE=OFF
         -DENABLE_ELASTICSEARCH=OFF
         -DENABLE_ENCRYPT_CONFIG=ON
         -DENABLE_EXPRESSION_LANGUAGE=ON
@@ -342,6 +345,7 @@ jobs:
         -DENABLE_BZIP2=ON
         -DENABLE_CIVET=ON
         -DENABLE_CONTROLLER=ON
+        -DENABLE_COUCHBASE=ON
         -DENABLE_ELASTICSEARCH=ON
         -DENABLE_ENCRYPT_CONFIG=ON
         -DENABLE_EXPRESSION_LANGUAGE=ON
diff --git a/.github/workflows/verify-package.yml b/.github/workflows/verify-package.yml
index b82f61512..73a69eecb 100644
--- a/.github/workflows/verify-package.yml
+++ b/.github/workflows/verify-package.yml
@@ -3,7 +3,7 @@ on: [workflow_dispatch]
 env:
   DOCKER_CMAKE_FLAGS: -DDOCKER_VERIFY_THREAD=3 -DUSE_SHARED_LIBS= -DSTRICT_GSL_CHECKS=AUDIT -DCI_BUILD=ON -DENABLE_AWS=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_MQTT=ON -DENABLE_AZURE=ON -DENABLE_SQL=ON \
     -DENABLE_SPLUNK=ON -DENABLE_GCP=ON -DENABLE_OPC=ON -DENABLE_PYTHON_SCRIPTING=ON -DENABLE_LUA_SCRIPTING=ON -DENABLE_KUBERNETES=ON -DENABLE_TEST_PROCESSORS=ON -DENABLE_PROMETHEUS=ON \
-    -DENABLE_ELASTICSEARCH=OFF -DENABLE_GRAFANA_LOKI=ON -DDOCKER_BUILD_ONLY=ON
+    -DENABLE_ELASTICSEARCH=OFF -DENABLE_GRAFANA_LOKI=ON -DENABLE_COUCHBASE=ON -DDOCKER_BUILD_ONLY=ON
   CCACHE_DIR: ${{ GITHUB.WORKSPACE }}/.ccache
 jobs:
   rocky-build:
diff --git a/CONTROLLERS.md b/CONTROLLERS.md
index e45ccbfb5..e3263854c 100644
--- a/CONTROLLERS.md
+++ b/CONTROLLERS.md
@@ -17,6 +17,7 @@ limitations under the License.
 
 - [AWSCredentialsService](#AWSCredentialsService)
 - [AzureStorageCredentialsService](#AzureStorageCredentialsService)
+- [CouchbaseClusterService](#CouchbaseClusterService)
 - [ElasticsearchCredentialsControllerService](#ElasticsearchCredentialsControllerService)
 - [GCPCredentialsControllerService](#GCPCredentialsControllerService)
 - [JsonRecordSetReader](#JsonRecordSetReader)
@@ -71,6 +72,23 @@ In the list below, the names of required properties appear in bold. Any other pr
 | **Use Managed Identity Credentials**   | false         | true<br/>false   | If true Managed Identity credentials will be used together with the Storage Account Name for authentication.                                                                                                                                                 |
 
 
+## CouchbaseClusterService
+
+### Description
+
+Provides a centralized Couchbase connection and bucket passwords management. Bucket passwords can be specified via dynamic properties.
+
+### Properties
+
+In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
+
+| Name                  | Default Value | Allowable Values | Description                                                                                                                                                      |
+|-----------------------|---------------|------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **Connection String** |               |                  | The hostnames or ip addresses of the bootstraping nodes and optional parameters. Syntax: couchbase://node1,node2,nodeN?param1=value1&param2=value2&paramN=valueN |
+| User Name             |               |                  | The user name to authenticate MiNiFi as a Couchbase client.                                                                                                      |
+| User Password         |               |                  | The user password to authenticate MiNiFi as a Couchbase client.<br/>**Sensitive Property: true**                                                                 |
+
+
 ## ElasticsearchCredentialsControllerService
 
 ### Description
diff --git a/LICENSE b/LICENSE
index 087a3fb55..5033bad4a 100644
--- a/LICENSE
+++ b/LICENSE
@@ -214,6 +214,7 @@ This product bundles 'Kubernetes Client Library for C' (kubernetes-client/c), wh
 This project bundles a configuration file from 'Kubernetes Metrics Server' (kubernetes-sigs/metrics-server), which is available under an ALv2 license
 This project bundles 'OpenSSL' which is available under an ALv2 license
 This project bundles 'gRPC' which is available under an ALv2 license
+This project bundles 'couchbase-cxx-client' which is available under an ALv2 license
 
 The Apache NiFi - MiNiFi C++ project contains subcomponents with separate copyright
 notices and license terms. Your use of the source code for the these
@@ -1002,7 +1003,7 @@ These libraries are in the public domain (or the equivalent where that is not po
 
 regexp.c and regexp.h from https://github.com/ccxvii/minilibs sha 875c33568b5a4aa4fb3dd0c52ea98f7f0e5ca684
 
-This product bundles snappy within librdkafka, under the license below.
+This product bundles snappy within librdkafka and couchbase-cxx-client, under the license below.
 
 LICENSE.snappy
 --------------------------------------------------------------
@@ -3307,3 +3308,154 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of
 The above copyright notice and this permission notice (including the next paragraph) shall be included in all copies or substantial portions of the Software.
 
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+This product bundles HdrHistogram within couchbase-cxx-client, under the license below.
+
+Creative Commons Legal Code
+
+CC0 1.0 Universal
+
+    CREATIVE COMMONS CORPORATION IS NOT A LAW FIRM AND DOES NOT PROVIDE
+    LEGAL SERVICES. DISTRIBUTION OF THIS DOCUMENT DOES NOT CREATE AN
+    ATTORNEY-CLIENT RELATIONSHIP. CREATIVE COMMONS PROVIDES THIS
+    INFORMATION ON AN "AS-IS" BASIS. CREATIVE COMMONS MAKES NO WARRANTIES
+    REGARDING THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS
+    PROVIDED HEREUNDER, AND DISCLAIMS LIABILITY FOR DAMAGES RESULTING FROM
+    THE USE OF THIS DOCUMENT OR THE INFORMATION OR WORKS PROVIDED
+    HEREUNDER.
+
+Statement of Purpose
+
+The laws of most jurisdictions throughout the world automatically confer
+exclusive Copyright and Related Rights (defined below) upon the creator
+and subsequent owner(s) (each and all, an "owner") of an original work of
+authorship and/or a database (each, a "Work").
+
+Certain owners wish to permanently relinquish those rights to a Work for
+the purpose of contributing to a commons of creative, cultural and
+scientific works ("Commons") that the public can reliably and without fear
+of later claims of infringement build upon, modify, incorporate in other
+works, reuse and redistribute as freely as possible in any form whatsoever
+and for any purposes, including without limitation commercial purposes.
+These owners may contribute to the Commons to promote the ideal of a free
+culture and the further production of creative, cultural and scientific
+works, or to gain reputation or greater distribution for their Work in
+part through the use and efforts of others.
+
+For these and/or other purposes and motivations, and without any
+expectation of additional consideration or compensation, the person
+associating CC0 with a Work (the "Affirmer"), to the extent that he or she
+is an owner of Copyright and Related Rights in the Work, voluntarily
+elects to apply CC0 to the Work and publicly distribute the Work under its
+terms, with knowledge of his or her Copyright and Related Rights in the
+Work and the meaning and intended legal effect of CC0 on those rights.
+
+1. Copyright and Related Rights. A Work made available under CC0 may be
+protected by copyright and related or neighboring rights ("Copyright and
+Related Rights"). Copyright and Related Rights include, but are not
+limited to, the following:
+
+  i. the right to reproduce, adapt, distribute, perform, display,
+     communicate, and translate a Work;
+ ii. moral rights retained by the original author(s) and/or performer(s);
+iii. publicity and privacy rights pertaining to a person's image or
+     likeness depicted in a Work;
+ iv. rights protecting against unfair competition in regards to a Work,
+     subject to the limitations in paragraph 4(a), below;
+  v. rights protecting the extraction, dissemination, use and reuse of data
+     in a Work;
+ vi. database rights (such as those arising under Directive 96/9/EC of the
+     European Parliament and of the Council of 11 March 1996 on the legal
+     protection of databases, and under any national implementation
+     thereof, including any amended or successor version of such
+     directive); and
+vii. other similar, equivalent or corresponding rights throughout the
+     world based on applicable law or treaty, and any national
+     implementations thereof.
+
+2. Waiver. To the greatest extent permitted by, but not in contravention
+of, applicable law, Affirmer hereby overtly, fully, permanently,
+irrevocably and unconditionally waives, abandons, and surrenders all of
+Affirmer's Copyright and Related Rights and associated claims and causes
+of action, whether now known or unknown (including existing as well as
+future claims and causes of action), in the Work (i) in all territories
+worldwide, (ii) for the maximum duration provided by applicable law or
+treaty (including future time extensions), (iii) in any current or future
+medium and for any number of copies, and (iv) for any purpose whatsoever,
+including without limitation commercial, advertising or promotional
+purposes (the "Waiver"). Affirmer makes the Waiver for the benefit of each
+member of the public at large and to the detriment of Affirmer's heirs and
+successors, fully intending that such Waiver shall not be subject to
+revocation, rescission, cancellation, termination, or any other legal or
+equitable action to disrupt the quiet enjoyment of the Work by the public
+as contemplated by Affirmer's express Statement of Purpose.
+
+3. Public License Fallback. Should any part of the Waiver for any reason
+be judged legally invalid or ineffective under applicable law, then the
+Waiver shall be preserved to the maximum extent permitted taking into
+account Affirmer's express Statement of Purpose. In addition, to the
+extent the Waiver is so judged Affirmer hereby grants to each affected
+person a royalty-free, non transferable, non sublicensable, non exclusive,
+irrevocable and unconditional license to exercise Affirmer's Copyright and
+Related Rights in the Work (i) in all territories worldwide, (ii) for the
+maximum duration provided by applicable law or treaty (including future
+time extensions), (iii) in any current or future medium and for any number
+of copies, and (iv) for any purpose whatsoever, including without
+limitation commercial, advertising or promotional purposes (the
+"License"). The License shall be deemed effective as of the date CC0 was
+applied by Affirmer to the Work. Should any part of the License for any
+reason be judged legally invalid or ineffective under applicable law, such
+partial invalidity or ineffectiveness shall not invalidate the remainder
+of the License, and in such case Affirmer hereby affirms that he or she
+will not (i) exercise any of his or her remaining Copyright and Related
+Rights in the Work or (ii) assert any associated claims and causes of
+action with respect to the Work, in either case contrary to Affirmer's
+express Statement of Purpose.
+
+4. Limitations and Disclaimers.
+
+ a. No trademark or patent rights held by Affirmer are waived, abandoned,
+    surrendered, licensed or otherwise affected by this document.
+ b. Affirmer offers the Work as-is and makes no representations or
+    warranties of any kind concerning the Work, express, implied,
+    statutory or otherwise, including without limitation warranties of
+    title, merchantability, fitness for a particular purpose, non
+    infringement, or the absence of latent or other defects, accuracy, or
+    the present or absence of errors, whether or not discoverable, all to
+    the greatest extent permissible under applicable law.
+ c. Affirmer disclaims responsibility for clearing rights of other persons
+    that may apply to the Work or any use thereof, including without
+    limitation any person's Copyright and Related Rights in the Work.
+    Further, Affirmer disclaims responsibility for obtaining any necessary
+    consents, permissions or other rights required for any use of the
+    Work.
+ d. Affirmer understands and acknowledges that Creative Commons is not a
+    party to this document and has no duty or obligation with respect to
+    this CC0 or use of the Work.
+
+
+This product bundles llhttp within couchbase-cxx-client, under the license below.
+
+This software is licensed under the MIT License.
+
+Copyright Fedor Indutny, 2018.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to permit
+persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be included
+in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
+NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
+OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/NOTICE b/NOTICE
index 8a2390bb3..81a9644b2 100644
--- a/NOTICE
+++ b/NOTICE
@@ -73,6 +73,9 @@ This software includes third party software subject to the following copyrights:
 - RE2 - Copyright (c) 2009 The RE2 Authors. All rights reserved.
 - c-ares - Copyright (c) 1998 Massachusetts Institute of Technology Copyright (c) 2007 - 2023 Daniel Stenberg with many contributors, see AUTHORS file.
 - lua - Copyright (c) 1994–2023 Lua.org, PUC-Rio.
+- couchbase-cxx-client - Copyright 2023-Present Couchbase, Inc.
+- snappy - Copyright 2011, Google Inc.
+- llhttp - Copyright Fedor Indutny, 2018.
 
 The licenses for these third party components are included in LICENSE.txt
 
diff --git a/PROCESSORS.md b/PROCESSORS.md
index e2ecf5eac..eec26bbac 100644
--- a/PROCESSORS.md
+++ b/PROCESSORS.md
@@ -77,6 +77,7 @@ limitations under the License.
 - [PushGrafanaLokiREST](#PushGrafanaLokiREST)
 - [PutAzureBlobStorage](#PutAzureBlobStorage)
 - [PutAzureDataLakeStorage](#PutAzureDataLakeStorage)
+- [PutCouchbaseKey](#PutCouchbaseKey)
 - [PutFile](#PutFile)
 - [PutGCSObject](#PutGCSObject)
 - [PutOPCProcessor](#PutOPCProcessor)
@@ -2204,6 +2205,47 @@ In the list below, the names of required properties appear in bold. Any other pr
 | failure | Files that could not be written to Azure storage for some reason are transferred to this relationship |
 
 
+## PutCouchbaseKey
+
+### Description
+
+Put a document to Couchbase Server via Key/Value access.
+
+### Properties
+
+In the list below, the names of required properties appear in bold. Any other properties (not in bold) are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.
+
+| Name                                     | Default Value | Allowable Values                                   | Description                                                                                                                                                                                                                                           |
+|------------------------------------------|---------------|----------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **Couchbase Cluster Controller Service** |               |                                                    | A Couchbase Cluster Controller Service which manages connections to a Couchbase cluster.                                                                                                                                                              |
+| **Bucket Name**                          | default       |                                                    | The name of bucket to access.<br/>**Supports Expression Language: true**                                                                                                                                                                              |
+| Scope Name                               |               |                                                    | Scope to use inside the bucket. If not specified, the _default scope is used.<br/>**Supports Expression Language: true**                                                                                                                              |
+| Collection Name                          |               |                                                    | Collection to use inside the bucket scope. If not specified, the _default collection is used.<br/>**Supports Expression Language: true**                                                                                                              |
+| **Document Type**                        | Json          | Json<br/>Binary<br/>String                         | Content type to store data as.                                                                                                                                                                                                                        |
+| Document Id                              |               |                                                    | A static, fixed Couchbase document id, or an expression to construct the Couchbase document id. If not specified, either the FlowFile uuid attribute or if that's not found a generated uuid will be used.<br/>**Supports Expression Language: true** |
+| **Persist To**                           | NONE          | NONE<br/>ACTIVE<br/>ONE<br/>TWO<br/>THREE<br/>FOUR | Durability constraint about disk persistence.                                                                                                                                                                                                         |
+| **Replicate To**                         | NONE          | NONE<br/>ONE<br/>TWO<br/>THREE                     | Durability constraint about replication.                                                                                                                                                                                                              |
+
+### Relationships
+
+| Name    | Description                                                                                                |
+|---------|------------------------------------------------------------------------------------------------------------|
+| success | All FlowFiles that are written to Couchbase Server are routed to this relationship.                        |
+| failure | All FlowFiles failed to be written to Couchbase Server and not retry-able are routed to this relationship. |
+| retry   | All FlowFiles failed to be written to Couchbase Server but can be retried are routed to this relationship. |
+
+### Output Attributes
+
+| Attribute                     | Relationship | Description                                   |
+|-------------------------------|--------------|-----------------------------------------------|
+| couchbase.bucket              | success      | Bucket where the document was stored.         |
+| couchbase.doc.id              | success      | Id of the document.                           |
+| couchbase.doc.cas             | success      | CAS of the document.                          |
+| couchbase.doc.sequence.number | success      | Sequence number associated with the document. |
+| couchbase.partition.uuid      | success      | UUID of partition.                            |
+| couchbase.partition.id        | success      | ID of partition (also known as vBucket).      |
+
+
 ## PutFile
 
 ### Description
diff --git a/README.md b/README.md
index 8285e4b4d..069d142ad 100644
--- a/README.md
+++ b/README.md
@@ -75,6 +75,7 @@ The next table outlines CMAKE flags that correspond with MiNiFi extensions. Exte
 | AWS                              | [AWSCredentialsService](CONTROLLERS.md#awscredentialsservice)<br/>[PutS3Object](PROCESSORS.md#puts3object)<br/>[DeleteS3Object](PROCESSORS.md#deletes3object)<br/>[FetchS3Object](PROCESSORS.md#fetchs3object)<br/>[ListS3](PROCESSORS.md#lists3)                                                                                                                                                                                                                       [...]
 | Azure                            | [AzureStorageCredentialsService](CONTROLLERS.md#azurestoragecredentialsservice)<br/>[PutAzureBlobStorage](PROCESSORS.md#putazureblobstorage)<br/>[DeleteAzureBlobStorage](PROCESSORS.md#deleteazureblobstorage)<br/>[FetchAzureBlobStorage](PROCESSORS.md#fetchazureblobstorage)<br/>[ListAzureBlobStorage](PROCESSORS.md#listazureblobstorage)<br/>[PutAzureDataLakeStorage](PROCESSORS.md#putazuredatalakestorage)<br/>[DeleteAzureDataLakeStorage](PROCESSORS.md#del [...]
 | CivetWeb                         | [ListenHTTP](PROCESSORS.md#listenhttp)                                                                                                                                                                                                                                                                                                                                                                                                                                  [...]
+| Couchbase                        | [CouchbaseClusterService](CONTROLLERS.md#couchbaseclusterservice)<br/>[PutCouchbaseKey](PROCESSORS.md#putcouchbasekey)                                                                                                                                                                                                                                                                                                                                                  [...]
 | Elasticsearch                    | [ElasticsearchCredentialsControllerService](CONTROLLERS.md#elasticsearchcredentialscontrollerservice)<br/>[PostElasticsearch](PROCESSORS.md#postelasticsearch)                                                                                                                                                                                                                                                                                                          [...]
 | ExecuteProcess (Linux and macOS) | [ExecuteProcess](PROCESSORS.md#executeprocess)                                                                                                                                                                                                                                                                                                                                                                                                                          [...]
 | Google Cloud Platform            | [DeleteGCSObject](PROCESSORS.md#deletegcsobject)<br>[FetchGCSObject](PROCESSORS.md#fetchgcsobject)<br>[GCPCredentialsControllerService](CONTROLLERS.md#gcpcredentialscontrollerservice)<br>[ListGCSBucket](PROCESSORS.md#listgcsbucket)<br>[PutGCSObject](PROCESSORS.md#putgcsobject)                                                                                                                                                                                   [...]
diff --git a/Windows.md b/Windows.md
index a87abd85f..3afb5d287 100644
--- a/Windows.md
+++ b/Windows.md
@@ -122,7 +122,7 @@ A basic working CMake configuration can be inferred from the `win_build_vs.bat`.
 ```
 mkdir build
 cd build
-cmake -G "Visual Studio 17 2022" -A x64 -DMINIFI_INCLUDE_VC_REDIST_MERGE_MODULES=OFF -DTEST_CUSTOM_WEL_PROVIDER=OFF -DENABLE_SQL=OFF -DMINIFI_USE_REAL_ODBC_TEST_DRIVER=OFF -DCMAKE_BUILD_TYPE_INIT=Release -DCMAKE_BUILD_TYPE=Release -DWIN32=WIN32 -DENABLE_LIBRDKAFKA=OFF -DENABLE_AWS=OFF -DENABLE_PDH= -DENABLE_AZURE=OFF -DENABLE_SFTP=OFF -DENABLE_SPLUNK= -DENABLE_GCP= -DENABLE_OPENCV=OFF -DENABLE_PROMETHEUS=OFF -DENABLE_ELASTICSEARCH= -DUSE_SHARED_LIBS=OFF -DENABLE_CONTROLLER=ON -DENABLE_BU [...]
+cmake -G "Visual Studio 17 2022" -A x64 -DMINIFI_INCLUDE_VC_REDIST_MERGE_MODULES=OFF -DTEST_CUSTOM_WEL_PROVIDER=OFF -DENABLE_SQL=OFF -DMINIFI_USE_REAL_ODBC_TEST_DRIVER=OFF -DCMAKE_BUILD_TYPE_INIT=Release -DCMAKE_BUILD_TYPE=Release -DWIN32=WIN32 -DENABLE_LIBRDKAFKA=OFF -DENABLE_AWS=OFF -DENABLE_PDH= -DENABLE_AZURE=OFF -DENABLE_SFTP=OFF -DENABLE_SPLUNK= -DENABLE_GCP= -DENABLE_OPENCV=OFF -DENABLE_PROMETHEUS=OFF -DENABLE_ELASTICSEARCH= -DUSE_SHARED_LIBS=OFF -DENABLE_CONTROLLER=ON -DENABLE_BU [...]
 msbuild /m nifi-minifi-cpp.sln /property:Configuration=Release /property:Platform=x64
 copy minifi_main\Release\minifi.exe minifi_main\
 cpack
diff --git a/bootstrap.sh b/bootstrap.sh
index 45e630ade..6b331de18 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -316,6 +316,8 @@ add_option PROCFS_ENABLED ${TRUE} "ENABLE_PROCFS"
 
 add_option PROMETHEUS_ENABLED ${TRUE} "ENABLE_PROMETHEUS"
 
+add_option COUCHBASE_ENABLED ${FALSE} "ENABLE_COUCHBASE"
+
 USE_SHARED_LIBS=${TRUE}
 ASAN_ENABLED=${FALSE}
 MINIFI_FAIL_ON_WARNINGS=${FALSE}
diff --git a/bstrp_functions.sh b/bstrp_functions.sh
index 471938d05..7311eb166 100755
--- a/bstrp_functions.sh
+++ b/bstrp_functions.sh
@@ -401,6 +401,7 @@ show_supported_features() {
   echo "AE. Prometheus Support .........$(print_feature_status PROMETHEUS_ENABLED)"
   echo "AF. Elasticsearch Support ......$(print_feature_status ELASTIC_ENABLED)"
   echo "AG. Grafana Loki Support .......$(print_feature_status GRAFANA_LOKI_ENABLED)"
+  echo "AH. Couchbase Support ..........$(print_feature_status COUCHBASE_ENABLED)"
   echo "****************************************"
   echo "            Build Options."
   echo "****************************************"
@@ -448,6 +449,7 @@ read_feature_options(){
     ae) ToggleFeature PROMETHEUS_ENABLED ;;
     af) ToggleFeature ELASTIC_ENABLED ;;
     ag) ToggleFeature GRAFANA_LOKI_ENABLED ;;
+    ah) ToggleFeature COUCHBASE_ENABLED ;;
     1) ToggleFeature TESTS_ENABLED ;;
     2) EnableAllFeatures ;;
     4) ToggleFeature USE_SHARED_LIBS;;
diff --git a/cmake/Asio.cmake b/cmake/Asio.cmake
index 28f4bb928..6f94e6afe 100644
--- a/cmake/Asio.cmake
+++ b/cmake/Asio.cmake
@@ -27,5 +27,5 @@ if(NOT asio_POPULATED)
     add_library(asio INTERFACE)
     target_include_directories(asio SYSTEM INTERFACE ${asio_SOURCE_DIR}/asio/include)
     find_package(Threads)
-    target_link_libraries(asio INTERFACE Threads::Threads)
+    target_link_libraries(asio INTERFACE Threads::Threads OpenSSL::SSL OpenSSL::Crypto)
 endif()
diff --git a/cmake/Bustache.cmake b/cmake/Bustache.cmake
index 6c037af6c..e3d104cda 100644
--- a/cmake/Bustache.cmake
+++ b/cmake/Bustache.cmake
@@ -21,8 +21,15 @@ include(GetFmt)
 get_fmt()
 
 set(BUSTACHE_USE_FMT ON CACHE STRING "" FORCE)
+
+set(PATCH_FILE "${CMAKE_SOURCE_DIR}/thirdparty/bustache/add-append.patch")
+
+set(PC ${Bash_EXECUTABLE}  -c "set -x &&\
+            (\\\"${Patch_EXECUTABLE}\\\" -p1 -R -s -f --dry-run -i \\\"${PATCH_FILE}\\\" || \\\"${Patch_EXECUTABLE}\\\" -p1 -N -i \\\"${PATCH_FILE}\\\")")
+
 FetchContent_Declare(Bustache
         GIT_REPOSITORY  https://github.com/jamboree/bustache.git
         GIT_TAG         47096caa8e1f9f7ebe34e3a022dbb822c174011d
+        PATCH_COMMAND   "${PC}"
 )
 FetchContent_MakeAvailable(Bustache)
diff --git a/cmake/Couchbase.cmake b/cmake/Couchbase.cmake
new file mode 100644
index 000000000..cf4ff7fb1
--- /dev/null
+++ b/cmake/Couchbase.cmake
@@ -0,0 +1,45 @@
+# 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.
+
+include(FetchContent)
+
+include(fmt)
+include(Spdlog)
+include(Asio)
+
+set(COUCHBASE_CXX_CLIENT_BUILD_STATIC ON CACHE BOOL "" FORCE)
+set(COUCHBASE_CXX_CLIENT_BUILD_SHARED OFF CACHE BOOL "" FORCE)
+set(COUCHBASE_CXX_CLIENT_BUILD_TESTS OFF CACHE BOOL "" FORCE)
+set(COUCHBASE_CXX_CLIENT_BUILD_DOCS OFF CACHE BOOL "" FORCE)
+set(COUCHBASE_CXX_CLIENT_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
+set(COUCHBASE_CXX_CLIENT_BUILD_TOOLS OFF CACHE BOOL "" FORCE)
+set(COUCHBASE_CXX_CLIENT_POST_LINKED_OPENSSL ON CACHE BOOL "" FORCE)
+set(COUCHBASE_CXX_CLIENT_INSTALL OFF CACHE BOOL "" FORCE)
+
+set(PATCH_FILE "${CMAKE_SOURCE_DIR}/thirdparty/couchbase/remove-thirdparty.patch")
+
+set(PC ${Bash_EXECUTABLE}  -c "set -x &&\
+            (\\\"${Patch_EXECUTABLE}\\\" -p1 -R -s -f --dry-run -i \\\"${PATCH_FILE}\\\" || \\\"${Patch_EXECUTABLE}\\\" -p1 -N -i \\\"${PATCH_FILE}\\\")")
+
+FetchContent_Declare(couchbase-cxx-client
+    URL      https://github.com/couchbase/couchbase-cxx-client/releases/download/1.0.2/couchbase-cxx-client-1.0.2.tar.gz
+    URL_HASH SHA256=1954e6f5e063d94675428182bc8b1b82fd8e8532c10d1787f157aeb18bb37769
+    PATCH_COMMAND "${PC}"
+)
+FetchContent_MakeAvailable(couchbase-cxx-client)
+
+set(COUCHBASE_INCLUDE_DIR "${couchbase-cxx-client_SOURCE_DIR}" CACHE STRING "" FORCE)
diff --git a/cmake/DockerConfig.cmake b/cmake/DockerConfig.cmake
index 7346de263..860503387 100644
--- a/cmake/DockerConfig.cmake
+++ b/cmake/DockerConfig.cmake
@@ -67,6 +67,7 @@ add_custom_target(
              -DENABLE_OPENCV=OFF
              -DENABLE_BUSTACHE=OFF
              -DENABLE_SFTP=OFF
+             -DENABLE_COUCHBASE=OFF
              -DENABLE_TEST_PROCESSORS=OFF
              -DENABLE_ROCKSDB=ON
              -DENABLE_LIBARCHIVE=ON
diff --git a/cmake/MiNiFiOptions.cmake b/cmake/MiNiFiOptions.cmake
index 8a7ccc58c..e69548ba0 100644
--- a/cmake/MiNiFiOptions.cmake
+++ b/cmake/MiNiFiOptions.cmake
@@ -111,6 +111,7 @@ add_minifi_option(ENABLE_TEST_PROCESSORS "Enables test processors" OFF)
 add_minifi_option(ENABLE_PROMETHEUS "Enables Prometheus support." ON)
 add_minifi_option(ENABLE_GRAFANA_LOKI "Enable Grafana Loki support" OFF)
 add_minifi_option(ENABLE_GRPC_FOR_LOKI "Enable gRPC for Grafana Loki extension" ON)
+add_minifi_option(ENABLE_COUCHBASE "Enable Couchbase support" OFF)
 add_minifi_option(ENABLE_EXECUTE_PROCESS "Enable ExecuteProcess processor" OFF)
 add_minifi_option(ENABLE_CONTROLLER "Enables the build of MiNiFi controller binary." ON)
 
diff --git a/cmake/Spdlog.cmake b/cmake/Spdlog.cmake
index 3b0729829..0631ca783 100644
--- a/cmake/Spdlog.cmake
+++ b/cmake/Spdlog.cmake
@@ -20,8 +20,8 @@ include(FetchContent)
 
 set(SPDLOG_FMT_EXTERNAL ON CACHE STRING "" FORCE)
 FetchContent_Declare(Spdlog
-        URL  https://github.com/gabime/spdlog/archive/refs/tags/v1.12.0.tar.gz
-        URL_HASH SHA256=4dccf2d10f410c1e2feaff89966bfc49a1abb29ef6f08246335b110e001e09a9
+        URL  https://github.com/gabime/spdlog/archive/refs/tags/v1.14.1.tar.gz
+        URL_HASH SHA256=1586508029a7d0670dfcb2d97575dcdc242d3868a259742b69f100801ab4e16b
         OVERRIDE_FIND_PACKAGE
         )
 FetchContent_MakeAvailable(Spdlog)
diff --git a/cmake/fmt.cmake b/cmake/fmt.cmake
index fc48799ce..93fd56efb 100644
--- a/cmake/fmt.cmake
+++ b/cmake/fmt.cmake
@@ -18,8 +18,8 @@
 #
 include(FetchContent)
 FetchContent_Declare(Fmt
-        URL  https://github.com/fmtlib/fmt/archive/refs/tags/10.1.0.tar.gz
-        URL_HASH SHA256=deb0a3ad2f5126658f2eefac7bf56a042488292de3d7a313526d667f3240ca0a
+        URL  https://github.com/fmtlib/fmt/archive/refs/tags/11.0.2.tar.gz
+        URL_HASH SHA256=6cb1e6d37bdcb756dbbe59be438790db409cdb4868c66e888d5df9f13f7c027f
         OVERRIDE_FIND_PACKAGE
         )
 FetchContent_MakeAvailable(Fmt)
diff --git a/docker/requirements.txt b/docker/requirements.txt
index 294f836ff..09e799589 100644
--- a/docker/requirements.txt
+++ b/docker/requirements.txt
@@ -12,3 +12,4 @@ azure-storage-blob==12.13.0
 prometheus-api-client==0.5.0
 humanfriendly==10.0
 requests<2.29  # https://github.com/docker/docker-py/issues/3113
+couchbase==4.3.2
diff --git a/docker/test/integration/cluster/ContainerStore.py b/docker/test/integration/cluster/ContainerStore.py
index f1e13a894..9c8527458 100644
--- a/docker/test/integration/cluster/ContainerStore.py
+++ b/docker/test/integration/cluster/ContainerStore.py
@@ -40,6 +40,7 @@ from .containers.GrafanaLokiContainer import GrafanaLokiContainer
 from .containers.GrafanaLokiContainer import GrafanaLokiOptions
 from .containers.ReverseProxyContainer import ReverseProxyContainer
 from .containers.DiagSlave import DiagSlave
+from .containers.CouchbaseServerContainer import CouchbaseServerContainer
 from .FeatureContext import FeatureContext
 
 
@@ -302,6 +303,14 @@ class ContainerStore:
                                                         network=self.network,
                                                         image_store=self.image_store,
                                                         command=command))
+        elif engine == "couchbase-server":
+            return self.containers.setdefault(container_name,
+                                              CouchbaseServerContainer(feature_context=feature_context,
+                                                                       name=container_name,
+                                                                       vols=self.vols,
+                                                                       network=self.network,
+                                                                       image_store=self.image_store,
+                                                                       command=command))
         else:
             raise Exception('invalid flow engine: \'%s\'' % engine)
 
@@ -411,3 +420,7 @@ class ContainerStore:
 
     def enable_ssl_in_nifi(self):
         self.nifi_options.use_ssl = True
+
+    def run_post_startup_commands(self, container_name):
+        container_name = self.get_container_name_with_postfix(container_name)
+        return self.containers[container_name].run_post_startup_commands()
diff --git a/docker/test/integration/cluster/DockerTestCluster.py b/docker/test/integration/cluster/DockerTestCluster.py
index 92e554fb0..e161d5da4 100644
--- a/docker/test/integration/cluster/DockerTestCluster.py
+++ b/docker/test/integration/cluster/DockerTestCluster.py
@@ -35,6 +35,7 @@ from .checkers.PrometheusChecker import PrometheusChecker
 from .checkers.SplunkChecker import SplunkChecker
 from .checkers.GrafanaLokiChecker import GrafanaLokiChecker
 from .checkers.ModbusChecker import ModbusChecker
+from .checkers.CouchbaseChecker import CouchbaseChecker
 from utils import get_peak_memory_usage, get_minifi_pid, get_memory_usage, retry_check
 
 
@@ -54,6 +55,7 @@ class DockerTestCluster:
         self.grafana_loki_checker = GrafanaLokiChecker()
         self.minifi_controller_executor = MinifiControllerExecutor(self.container_communicator)
         self.modbus_checker = ModbusChecker(self.container_communicator)
+        self.couchbase_checker = CouchbaseChecker()
 
     def cleanup(self):
         self.container_store.cleanup()
@@ -308,8 +310,11 @@ class DockerTestCluster:
         startup_success = self.wait_for_startup_log(container_name, 300)
         if not startup_success:
             logging.error("Cluster startup failed for %s", container_name)
-            self.log_app_output()
-        return startup_success
+            return False
+        if not self.container_store.run_post_startup_commands(container_name):
+            logging.error("Failed to run post startup commands for container %s", container_name)
+            return False
+        return True
 
     def wait_for_all_containers_to_finish_startup(self):
         for container_name in self.container_store.get_container_names():
@@ -424,3 +429,6 @@ class DockerTestCluster:
 
     def enable_ssl_in_nifi(self):
         self.container_store.enable_ssl_in_nifi()
+
+    def is_data_present_in_couchbase(self, doc_id: str, bucket_name: str, expected_data: str, expected_data_type: str):
+        return self.couchbase_checker.is_data_present_in_couchbase(doc_id, bucket_name, expected_data, expected_data_type)
diff --git a/docker/test/integration/cluster/checkers/CouchbaseChecker.py b/docker/test/integration/cluster/checkers/CouchbaseChecker.py
new file mode 100644
index 000000000..07a332cbf
--- /dev/null
+++ b/docker/test/integration/cluster/checkers/CouchbaseChecker.py
@@ -0,0 +1,69 @@
+# 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.
+import logging
+import json
+from couchbase.cluster import Cluster
+from couchbase.options import ClusterOptions
+from couchbase.auth import PasswordAuthenticator
+from couchbase.transcoder import RawBinaryTranscoder, RawStringTranscoder
+
+
+class CouchbaseChecker:
+    def is_data_present_in_couchbase(self, doc_id: str, bucket_name: str, expected_data: str, expected_data_type: str):
+        try:
+            cluster = Cluster('couchbase://localhost', ClusterOptions(
+                PasswordAuthenticator('Administrator', 'password123')))
+
+            bucket = cluster.bucket(bucket_name)
+            collection = bucket.default_collection()
+
+            if expected_data_type.lower() == "binary":
+                binary_flag = 0x03 << 24
+                result = collection.get(doc_id, transcoder=RawBinaryTranscoder())
+                flags = result.flags
+                if not flags & binary_flag:
+                    logging.error(f"Expected binary data for document '{doc_id}' but no binary flags were found.")
+                    return False
+
+                content = result.content_as[bytes]
+                return content.decode('utf-8') == expected_data
+
+            if expected_data_type.lower() == "json":
+                json_flag = 0x02 << 24
+                result = collection.get(doc_id)
+                flags = result.flags
+                if not flags & json_flag:
+                    logging.error(f"Expected JSON data for document '{doc_id}' but no JSON flags were found.")
+                    return False
+
+                content = result.content_as[dict]
+                return content == json.loads(expected_data)
+
+            if expected_data_type.lower() == "string":
+                string_flag = 0x04 << 24
+                result = collection.get(doc_id, transcoder=RawStringTranscoder())
+                flags = result.flags
+                if not flags & string_flag:
+                    logging.error(f"Expected string data for document '{doc_id}' but no string flags were found.")
+                    return False
+
+                content = result.content_as[str]
+                return content == expected_data
+
+            logging.error(f"Unsupported data type '{expected_data_type}'")
+            return False
+        except Exception as e:
+            logging.error(f"Error while fetching document '{doc_id}' from bucket '{bucket_name}': {e}")
+            return False
diff --git a/docker/test/integration/cluster/containers/Container.py b/docker/test/integration/cluster/containers/Container.py
index b4a8efe85..d2e73fd4b 100644
--- a/docker/test/integration/cluster/containers/Container.py
+++ b/docker/test/integration/cluster/containers/Container.py
@@ -34,6 +34,7 @@ class Container:
         # Get docker client
         self.client = docker.from_env()
         self.deployed = False
+        self.post_startup_commands_finished = False
 
     def cleanup(self):
         logging.info('Cleaning up container: %s', self.name)
@@ -84,3 +85,6 @@ class Container:
 
     def get_app_log(self):
         raise NotImplementedError()
+
+    def run_post_startup_commands(self):
+        return True
diff --git a/docker/test/integration/cluster/containers/CouchbaseServerContainer.py b/docker/test/integration/cluster/containers/CouchbaseServerContainer.py
new file mode 100644
index 000000000..1c4353046
--- /dev/null
+++ b/docker/test/integration/cluster/containers/CouchbaseServerContainer.py
@@ -0,0 +1,55 @@
+# 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.
+from .Container import Container
+from utils import retry_check
+
+
+class CouchbaseServerContainer(Container):
+    def __init__(self, feature_context, name, vols, network, image_store, command=None):
+        super().__init__(feature_context, name, 'couchbase-server', vols, network, image_store, command)
+
+    def get_startup_finished_log_entry(self):
+        # after startup the logs are only available in the container, only this message is shown
+        return "logs available in"
+
+    @retry_check(15, 2)
+    def run_post_startup_commands(self):
+        if self.post_startup_commands_finished:
+            return True
+
+        commands = [
+            ["couchbase-cli", "cluster-init", "-c", "localhost", "--cluster-username", "Administrator", "--cluster-password", "password123", "--services", "data,index,query",
+             "--cluster-ramsize", "2048", "--cluster-index-ramsize", "256"],
+            ["couchbase-cli", "bucket-create", "-c", "localhost", "--username", "Administrator", "--password", "password123", "--bucket", "test_bucket", "--bucket-type", "couchbase",
+             "--bucket-ramsize", "1024"]
+        ]
+        for command in commands:
+            (code, _) = self.client.containers.get(self.name).exec_run(command)
+            if code != 0:
+                return False
+        self.post_startup_commands_finished = True
+        return True
+
+    def deploy(self):
+        if not self.set_deployed():
+            return
+
+        self.docker_container = self.client.containers.run(
+            "couchbase:community-7.6.2",
+            detach=True,
+            name=self.name,
+            network=self.network.name,
+            ports={'11210/tcp': 11210},
+            entrypoint=self.command)
diff --git a/docker/test/integration/features/MiNiFi_integration_test_driver.py b/docker/test/integration/features/MiNiFi_integration_test_driver.py
index 16a30c7ee..57526342d 100644
--- a/docker/test/integration/features/MiNiFi_integration_test_driver.py
+++ b/docker/test/integration/features/MiNiFi_integration_test_driver.py
@@ -63,38 +63,43 @@ class MiNiFi_integration_test:
         self.cluster.acquire_container(context=context, name='kafka-broker', engine='kafka-broker')
         self.cluster.deploy_container(name='zookeeper')
         self.cluster.deploy_container(name='kafka-broker')
-        assert self.cluster.wait_for_container_startup_to_finish('kafka-broker')
+        assert self.cluster.wait_for_container_startup_to_finish('kafka-broker') or self.cluster.log_app_output()
 
     def start_splunk(self, context):
         self.cluster.acquire_container(context=context, name='splunk', engine='splunk')
         self.cluster.deploy_container(name='splunk')
-        assert self.cluster.wait_for_container_startup_to_finish('splunk')
-        assert self.cluster.enable_splunk_hec_indexer('splunk', 'splunk_hec_token')
+        assert self.cluster.wait_for_container_startup_to_finish('splunk') or self.cluster.log_app_output()
+        assert self.cluster.enable_splunk_hec_indexer('splunk', 'splunk_hec_token') or self.cluster.log_app_output()
 
     def start_elasticsearch(self, context):
         self.cluster.acquire_container(context=context, name='elasticsearch', engine='elasticsearch')
         self.cluster.deploy_container('elasticsearch')
-        assert self.cluster.wait_for_container_startup_to_finish('elasticsearch')
+        assert self.cluster.wait_for_container_startup_to_finish('elasticsearch') or self.cluster.log_app_output()
 
     def start_opensearch(self, context):
         self.cluster.acquire_container(context=context, name='opensearch', engine='opensearch')
         self.cluster.deploy_container('opensearch')
-        assert self.cluster.wait_for_container_startup_to_finish('opensearch')
+        assert self.cluster.wait_for_container_startup_to_finish('opensearch') or self.cluster.log_app_output()
 
     def start_minifi_c2_server(self, context):
         self.cluster.acquire_container(context=context, name="minifi-c2-server", engine="minifi-c2-server")
         self.cluster.deploy_container('minifi-c2-server')
-        assert self.cluster.wait_for_container_startup_to_finish('minifi-c2-server')
+        assert self.cluster.wait_for_container_startup_to_finish('minifi-c2-server') or self.cluster.log_app_output()
+
+    def start_couchbase_server(self, context):
+        self.cluster.acquire_container(context=context, name='couchbase-server', engine='couchbase-server')
+        self.cluster.deploy_container('couchbase-server')
+        assert self.cluster.wait_for_container_startup_to_finish('couchbase-server') or self.cluster.log_app_output()
 
     def start(self, container_name=None):
         if container_name is not None:
             logging.info("Starting container %s", container_name)
             self.cluster.deploy_container(container_name)
-            assert self.cluster.wait_for_container_startup_to_finish(container_name)
+            assert self.cluster.wait_for_container_startup_to_finish(container_name) or self.cluster.log_app_output()
             return
         logging.info("MiNiFi_integration_test start")
         self.cluster.deploy_all()
-        assert self.cluster.wait_for_all_containers_to_finish_startup()
+        assert self.cluster.wait_for_all_containers_to_finish_startup() or self.cluster.log_app_output()
 
     def stop(self, container_name):
         logging.info("Stopping container %s", container_name)
@@ -443,3 +448,6 @@ class MiNiFi_integration_test:
 
     def enable_ssl_in_nifi(self):
         self.cluster.enable_ssl_in_nifi()
+
+    def check_is_data_present_on_couchbase(self, doc_id: str, bucket_name: str, expected_data: str, expected_data_type: str):
+        assert self.cluster.is_data_present_in_couchbase(doc_id, bucket_name, expected_data, expected_data_type)
diff --git a/docker/test/integration/features/couchbase.feature b/docker/test/integration/features/couchbase.feature
new file mode 100644
index 000000000..446821f25
--- /dev/null
+++ b/docker/test/integration/features/couchbase.feature
@@ -0,0 +1,67 @@
+# 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.
+
+@ENABLE_COUCHBASE
+Feature: Executing Couchbase operations from MiNiFi-C++
+  Background:
+    Given the content of "/tmp/output" is monitored
+
+  Scenario: A MiNiFi instance can insert json data to test bucket with PutCouchbaseKey processor
+    Given a GetFile processor with the "Input Directory" property set to "/tmp/input"
+    And a file with the content '{"field1": "value1", "field2": "value2"}' is present in '/tmp/input'
+    And a PutCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the PutCouchbaseKey processor is set to "test_doc_id"
+    And the "Document Type" property of the PutCouchbaseKey processor is set to "Json"
+    And the "Couchbase Cluster Controller Service" property of the PutCouchbaseKey processor is set to "CouchbaseClusterService"
+    And a LogAttribute processor with the "FlowFiles To Log" property set to "0"
+    And a CouchbaseClusterService is setup up with the name "CouchbaseClusterService"
+
+    And the "success" relationship of the GetFile processor is connected to the PutCouchbaseKey
+    And the "success" relationship of the PutCouchbaseKey processor is connected to the LogAttribute
+
+    When a Couchbase server is started
+    And all instances start up
+
+    Then the Minifi logs contain the following message: "key:couchbase.bucket value:test_bucket" in less than 60 seconds
+    And the Minifi logs contain the following message: "key:couchbase.doc.id value:test_doc_id" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.cas value:[1-9][0-9]*" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.sequence.number value:[1-9][0-9]*" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.partition.uuid value:[1-9][0-9]*" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.partition.id value:[1-9][0-9]*" in less than 1 seconds
+    And a document with id "test_doc_id" in bucket "test_bucket" is present with data '{"field1": "value1", "field2": "value2"}' of type "Json" in Couchbase
+
+  Scenario: A MiNiFi instance can insert binary data to test bucket with PutCouchbaseKey processor
+    Given a GetFile processor with the "Input Directory" property set to "/tmp/input"
+    And a file with the content '{"field1": "value1"}' is present in '/tmp/input'
+    And a PutCouchbaseKey processor with the "Bucket Name" property set to "test_bucket"
+    And the "Document Id" property of the PutCouchbaseKey processor is set to "test_doc_id"
+    And the "Document Type" property of the PutCouchbaseKey processor is set to "Binary"
+    And the "Couchbase Cluster Controller Service" property of the PutCouchbaseKey processor is set to "CouchbaseClusterService"
+    And a LogAttribute processor with the "FlowFiles To Log" property set to "0"
+    And a CouchbaseClusterService is setup up with the name "CouchbaseClusterService"
+
+    And the "success" relationship of the GetFile processor is connected to the PutCouchbaseKey
+    And the "success" relationship of the PutCouchbaseKey processor is connected to the LogAttribute
+
+    When a Couchbase server is started
+    And all instances start up
+
+    Then the Minifi logs contain the following message: "key:couchbase.bucket value:test_bucket" in less than 60 seconds
+    And the Minifi logs contain the following message: "key:couchbase.doc.id value:test_doc_id" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.cas value:[1-9][0-9]*" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.doc.sequence.number value:[1-9][0-9]*" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.partition.uuid value:[1-9][0-9]*" in less than 1 seconds
+    And the Minifi logs match the following regex: "key:couchbase.partition.id value:[1-9][0-9]*" in less than 1 seconds
+    And a document with id "test_doc_id" in bucket "test_bucket" is present with data '{"field1": "value1"}' of type "Binary" in Couchbase
diff --git a/docker/test/integration/features/steps/steps.py b/docker/test/integration/features/steps/steps.py
index ea099b21d..6d4e464e9 100644
--- a/docker/test/integration/features/steps/steps.py
+++ b/docker/test/integration/features/steps/steps.py
@@ -26,6 +26,7 @@ from minifi.controllers.ODBCService import ODBCService
 from minifi.controllers.KubernetesControllerService import KubernetesControllerService
 from minifi.controllers.JsonRecordSetWriter import JsonRecordSetWriter
 from minifi.controllers.JsonRecordSetReader import JsonRecordSetReader
+from minifi.controllers.CouchbaseClusterService import CouchbaseClusterService
 
 from behave import given, then, when
 from behave.model_describe import ModelDescriptor
@@ -1366,3 +1367,23 @@ def step_impl(context):
 @given(u'PLC register has been set with {modbus_cmd} command')
 def step_impl(context, modbus_cmd):
     context.test.set_value_on_plc_with_modbus(context.test.get_container_name_with_postfix('diag-slave-tcp'), modbus_cmd)
+
+
+# Couchbase
+@when(u'a Couchbase server is started')
+def step_impl(context):
+    context.test.start_couchbase_server(context)
+
+
+@given("a CouchbaseClusterService is setup up with the name \"{service_name}\"")
+def step_impl(context, service_name):
+    couchbase_cluster_controller_service = CouchbaseClusterService(
+        name=service_name,
+        connection_string="couchbase://{server_hostname}".format(server_hostname=context.test.get_container_name_with_postfix("couchbase-server")))
+    container = context.test.acquire_container(context=context, name="minifi-cpp-flow")
+    container.add_controller(couchbase_cluster_controller_service)
+
+
+@then("a document with id \"{doc_id}\" in bucket \"{bucket_name}\" is present with data '{data}' of type \"{data_type}\" in Couchbase")
+def step_impl(context, doc_id: str, bucket_name: str, data: str, data_type: str):
+    context.test.check_is_data_present_on_couchbase(doc_id, bucket_name, data, data_type)
diff --git a/docker/test/integration/minifi/controllers/CouchbaseClusterService.py b/docker/test/integration/minifi/controllers/CouchbaseClusterService.py
new file mode 100644
index 000000000..e06c1e6ff
--- /dev/null
+++ b/docker/test/integration/minifi/controllers/CouchbaseClusterService.py
@@ -0,0 +1,27 @@
+# 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.
+
+
+from ..core.ControllerService import ControllerService
+
+
+class CouchbaseClusterService(ControllerService):
+    def __init__(self, name, connection_string):
+        super(CouchbaseClusterService, self).__init__(name=name)
+
+        self.service_class = 'CouchbaseClusterService'
+        self.properties['Connection String'] = connection_string
+        self.properties['User Name'] = "Administrator"
+        self.properties['User Password'] = "password123"
diff --git a/docker/test/integration/minifi/processors/PutCouchbaseKey.py b/docker/test/integration/minifi/processors/PutCouchbaseKey.py
new file mode 100644
index 000000000..5e94aaa07
--- /dev/null
+++ b/docker/test/integration/minifi/processors/PutCouchbaseKey.py
@@ -0,0 +1,24 @@
+# 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.
+from ..core.Processor import Processor
+
+
+class PutCouchbaseKey(Processor):
+    def __init__(self, context, schedule={'scheduling strategy': 'EVENT_DRIVEN'}):
+        super(PutCouchbaseKey, self).__init__(
+            context=context,
+            clazz='PutCouchbaseKey',
+            auto_terminate=['success', 'failure'],
+            schedule=schedule)
diff --git a/cmake/Asio.cmake b/extensions/couchbase/CMakeLists.txt
similarity index 51%
copy from cmake/Asio.cmake
copy to extensions/couchbase/CMakeLists.txt
index 28f4bb928..0299ce8fd 100644
--- a/cmake/Asio.cmake
+++ b/extensions/couchbase/CMakeLists.txt
@@ -1,3 +1,4 @@
+#
 # 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
@@ -14,18 +15,22 @@
 # KIND, either express or implied.  See the License for the
 # specific language governing permissions and limitations
 # under the License.
+#
 
-include(FetchContent)
+if (NOT (ENABLE_ALL OR ENABLE_COUCHBASE))
+    return()
+endif()
 
-FetchContent_Declare(asio
-        URL https://github.com/chriskohlhoff/asio/archive/refs/tags/asio-1-28-1.tar.gz
-        URL_HASH SHA256=5ff6111ec8cbe73a168d997c547f562713aa7bd004c5c02326f0e9d579a5f2ce)
+include(Couchbase)
+include(${CMAKE_SOURCE_DIR}/extensions/ExtensionHeader.txt)
 
-FetchContent_GetProperties(asio)
-if(NOT asio_POPULATED)
-    FetchContent_Populate(asio)
-    add_library(asio INTERFACE)
-    target_include_directories(asio SYSTEM INTERFACE ${asio_SOURCE_DIR}/asio/include)
-    find_package(Threads)
-    target_link_libraries(asio INTERFACE Threads::Threads)
-endif()
+file(GLOB SOURCES  "*.cpp" "controllerservices/*.cpp" "processors/*.cpp")
+
+add_minifi_library(minifi-couchbase SHARED ${SOURCES})
+
+target_include_directories(minifi-couchbase PRIVATE BEFORE "${CMAKE_CURRENT_SOURCE_DIR}" "controllerservices" "processors" ${COUCHBASE_INCLUDE_DIR})
+target_link_libraries(minifi-couchbase ${LIBMINIFI} couchbase_cxx_client_static hdr_histogram_static snappy llhttp::llhttp)
+
+register_extension(minifi-couchbase "COUCHBASE EXTENSIONS" COUCHBASE-EXTENSIONS "This enables Couchbase support" "extensions/couchbase/tests")
+
+register_extension_linter(minifi-couchbase-extensions-linter)
diff --git a/extensions/couchbase/controllerservices/CouchbaseClusterService.cpp b/extensions/couchbase/controllerservices/CouchbaseClusterService.cpp
new file mode 100644
index 000000000..5207657f2
--- /dev/null
+++ b/extensions/couchbase/controllerservices/CouchbaseClusterService.cpp
@@ -0,0 +1,168 @@
+/**
+ *
+ * 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.
+ */
+
+#include "CouchbaseClusterService.h"
+#include "couchbase/codec/raw_binary_transcoder.hxx"
+#include "couchbase/codec/raw_string_transcoder.hxx"
+#include "couchbase/codec/raw_json_transcoder.hxx"
+
+#include "core/Resource.h"
+
+namespace org::apache::nifi::minifi::couchbase {
+
+namespace {
+
+constexpr auto temporary_connection_errors = std::to_array<::couchbase::errc::common>({
+  ::couchbase::errc::common::temporary_failure,
+  ::couchbase::errc::common::request_canceled,
+  ::couchbase::errc::common::internal_server_failure,
+  ::couchbase::errc::common::cas_mismatch,
+  ::couchbase::errc::common::ambiguous_timeout,
+  ::couchbase::errc::common::unambiguous_timeout,
+  ::couchbase::errc::common::rate_limited,
+  ::couchbase::errc::common::quota_limited
+});
+
+CouchbaseErrorType getErrorType(const std::error_code& error_code) {
+  for (const auto& temporary_error : temporary_connection_errors) {
+    if (static_cast<int>(temporary_error) == error_code.value()) {
+      return CouchbaseErrorType::TEMPORARY;
+    }
+  }
+  return CouchbaseErrorType::FATAL;
+}
+
+}  // namespace
+
+nonstd::expected<::couchbase::collection, CouchbaseErrorType> CouchbaseClient::getCollection(const CouchbaseCollection& collection) {
+  auto connection_result = establishConnection();
+  if (!connection_result) {
+    return nonstd::make_unexpected(connection_result.error());
+  }
+  std::lock_guard<std::mutex> lock(cluster_mutex_);
+  return cluster_->bucket(collection.bucket_name).scope(collection.scope_name).collection(collection.collection_name);
+}
+
+nonstd::expected<CouchbaseUpsertResult, CouchbaseErrorType> CouchbaseClient::upsert(const CouchbaseCollection& collection,
+    CouchbaseValueType document_type, const std::string& document_id, const std::vector<std::byte>& buffer, const ::couchbase::upsert_options& options) {
+  auto collection_result = getCollection(collection);
+  if (!collection_result.has_value()) {
+    return nonstd::make_unexpected(collection_result.error());
+  }
+
+  std::pair<::couchbase::error, ::couchbase::mutation_result> result;
+  if (document_type == CouchbaseValueType::Json) {
+    result = collection_result->upsert<::couchbase::codec::raw_json_transcoder>(document_id, buffer, options).get();
+  } else if (document_type == CouchbaseValueType::String) {
+    std::string data_str(reinterpret_cast<const char*>(buffer.data()), buffer.size());
+    result = collection_result->upsert<::couchbase::codec::raw_string_transcoder>(document_id, data_str, options).get();
+  } else {
+    result = collection_result->upsert<::couchbase::codec::raw_binary_transcoder>(document_id, buffer, options).get();
+  }
+  auto& [upsert_err, upsert_resp] = result;
+  if (upsert_err.ec()) {
+    // ambiguous_timeout should not be retried as we do not know if the insert was successful or not
+    if (getErrorType(upsert_err.ec()) == CouchbaseErrorType::TEMPORARY && upsert_err.ec().value() != static_cast<int>(::couchbase::errc::common::ambiguous_timeout)) {
+      logger_->log_error("Failed to upsert document '{}' to collection '{}.{}.{}' due to temporary issue, error code: '{}', message: '{}'",
+        document_id, collection.bucket_name, collection.scope_name, collection.collection_name, upsert_err.ec(), upsert_err.message());
+      return nonstd::make_unexpected(CouchbaseErrorType::TEMPORARY);
+    }
+    logger_->log_error("Failed to upsert document '{}' to collection '{}.{}.{}' with error code: '{}', message: '{}'",
+      document_id, collection.bucket_name, collection.scope_name, collection.collection_name, upsert_err.ec(), upsert_err.message());
+    return nonstd::make_unexpected(CouchbaseErrorType::FATAL);
+  } else {
+    const uint64_t partition_uuid = (upsert_resp.mutation_token().has_value() ? upsert_resp.mutation_token()->partition_uuid() : 0);
+    const uint64_t sequence_number = (upsert_resp.mutation_token().has_value() ? upsert_resp.mutation_token()->sequence_number() : 0);
+    const uint16_t partition_id = (upsert_resp.mutation_token().has_value() ? upsert_resp.mutation_token()->partition_id() : 0);
+    return CouchbaseUpsertResult {
+      collection.bucket_name,
+      upsert_resp.cas().value(),
+      partition_uuid,
+      sequence_number,
+      partition_id
+    };
+  }
+}
+
+void CouchbaseClient::close() {
+  std::lock_guard<std::mutex> lock(cluster_mutex_);
+  if (cluster_) {
+    cluster_->close().wait();
+  }
+  cluster_ = std::nullopt;
+}
+
+nonstd::expected<void, CouchbaseErrorType> CouchbaseClient::establishConnection() {
+  std::lock_guard<std::mutex> lock(cluster_mutex_);
+  if (cluster_) {
+    return {};
+  }
+
+  auto options = ::couchbase::cluster_options(username_, password_);
+  auto [connect_err, cluster] = ::couchbase::cluster::connect(connection_string_, options).get();
+  if (connect_err.ec()) {
+    logger_->log_error("Failed to connect to Couchbase cluster with error code: '{}' and message: '{}'", connect_err.ec(), connect_err.message());
+    return nonstd::make_unexpected(getErrorType(connect_err.ec()));
+  }
+
+  cluster_ = std::move(cluster);
+  return {};
+}
+
+namespace controllers {
+
+void CouchbaseClusterService::initialize() {
+  setSupportedProperties(Properties);
+}
+
+void CouchbaseClusterService::onEnable() {
+  std::string connection_string;
+  getProperty(ConnectionString, connection_string);
+  std::string username;
+  getProperty(UserName, username);
+  std::string password;
+  getProperty(UserPassword, password);
+  if (connection_string.empty() || username.empty() || password.empty()) {
+    throw minifi::Exception(ExceptionType::PROCESS_SCHEDULE_EXCEPTION, "Missing connection string, username or password");
+  }
+
+  client_ = std::make_unique<CouchbaseClient>(connection_string, username, password, logger_);
+  auto result = client_->establishConnection();
+  if (!result) {
+    if (result.error() == CouchbaseErrorType::FATAL) {
+      throw minifi::Exception(ExceptionType::PROCESS_SCHEDULE_EXCEPTION, "Failed to connect to Couchbase cluster with fatal error");
+    }
+    logger_->log_warn("Failed to connect to Couchbase cluster with temporary error, will retry connection when a Couchbase processor is triggered");
+  }
+}
+
+gsl::not_null<std::shared_ptr<CouchbaseClusterService>> CouchbaseClusterService::getFromProperty(const core::ProcessContext& context, const core::PropertyReference& property) {
+  std::shared_ptr<CouchbaseClusterService> couchbase_cluster_service;
+  if (auto connection_controller_name = context.getProperty(property)) {
+    couchbase_cluster_service = std::dynamic_pointer_cast<CouchbaseClusterService>(context.getControllerService(*connection_controller_name, context.getProcessorNode()->getUUID()));
+  }
+  if (!couchbase_cluster_service) {
+    throw minifi::Exception(ExceptionType::PROCESS_SCHEDULE_EXCEPTION, "Missing Couchbase Cluster Service");
+  }
+  return gsl::make_not_null(couchbase_cluster_service);
+}
+
+REGISTER_RESOURCE(CouchbaseClusterService, ControllerService);
+
+}  // namespace controllers
+}  // namespace org::apache::nifi::minifi::couchbase
diff --git a/extensions/couchbase/controllerservices/CouchbaseClusterService.h b/extensions/couchbase/controllerservices/CouchbaseClusterService.h
new file mode 100644
index 000000000..b848b741d
--- /dev/null
+++ b/extensions/couchbase/controllerservices/CouchbaseClusterService.h
@@ -0,0 +1,162 @@
+/**
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <memory>
+#include <string>
+#include <utility>
+#include <mutex>
+
+#include "core/controller/ControllerService.h"
+#include "core/PropertyDefinition.h"
+#include "core/PropertyDefinitionBuilder.h"
+#include "core/PropertyType.h"
+#include "couchbase/cluster.hxx"
+#include "core/ProcessContext.h"
+#include "core/logging/LoggerConfiguration.h"
+
+namespace org::apache::nifi::minifi::couchbase {
+
+struct CouchbaseCollection {
+  std::string bucket_name;
+  std::string scope_name;
+  std::string collection_name;
+};
+
+struct CouchbaseUpsertResult {
+  std::string bucket_name;
+  std::uint64_t cas{0};
+  std::uint64_t sequence_number{0};
+  std::uint64_t partition_uuid{0};
+  std::uint16_t partition_id{0};
+};
+
+enum class CouchbaseValueType {
+  Json,
+  Binary,
+  String
+};
+
+enum class CouchbaseErrorType {
+  FATAL,
+  TEMPORARY,
+};
+
+class CouchbaseClient {
+ public:
+  CouchbaseClient(std::string connection_string, std::string username, std::string password, const std::shared_ptr<core::logging::Logger>& logger)
+    : connection_string_(std::move(connection_string)), username_(std::move(username)), password_(std::move(password)), logger_(logger) {
+  }
+
+  ~CouchbaseClient() {
+    close();
+  }
+
+  CouchbaseClient(const CouchbaseClient&) = delete;
+  CouchbaseClient(CouchbaseClient&&) = delete;
+  CouchbaseClient& operator=(CouchbaseClient&&) = delete;
+  CouchbaseClient& operator=(const CouchbaseClient&) = delete;
+
+  nonstd::expected<CouchbaseUpsertResult, CouchbaseErrorType> upsert(const CouchbaseCollection& collection, CouchbaseValueType document_type, const std::string& document_id,
+    const std::vector<std::byte>& buffer, const ::couchbase::upsert_options& options);
+  nonstd::expected<void, CouchbaseErrorType> establishConnection();
+  void close();
+
+ private:
+  nonstd::expected<::couchbase::collection, CouchbaseErrorType> getCollection(const CouchbaseCollection& collection);
+
+  std::string connection_string_;
+  std::string username_;
+  std::string password_;
+  std::mutex cluster_mutex_;
+  std::optional<::couchbase::cluster> cluster_;
+  std::shared_ptr<core::logging::Logger> logger_;
+};
+
+namespace controllers {
+
+class CouchbaseClusterService : public core::controller::ControllerService {
+ public:
+  explicit CouchbaseClusterService(std::string_view name, const minifi::utils::Identifier &uuid = {})
+      : ControllerService(name, uuid) {
+  }
+
+  explicit CouchbaseClusterService(std::string_view name, const std::shared_ptr<Configure>& /*configuration*/)
+      : ControllerService(name) {
+  }
+
+  EXTENSIONAPI static constexpr const char* Description = "Provides a centralized Couchbase connection and bucket passwords management. Bucket passwords can be specified via dynamic properties.";
+
+  EXTENSIONAPI static constexpr auto ConnectionString = core::PropertyDefinitionBuilder<>::createProperty("Connection String")
+      .withDescription("The hostnames or ip addresses of the bootstraping nodes and optional parameters. Syntax: couchbase://node1,node2,nodeN?param1=value1&param2=value2&paramN=valueN")
+      .isRequired(true)
+      .build();
+  EXTENSIONAPI static constexpr auto UserName = core::PropertyDefinitionBuilder<>::createProperty("User Name")
+      .withDescription("The user name to authenticate MiNiFi as a Couchbase client.")
+      .build();
+  EXTENSIONAPI static constexpr auto UserPassword = core::PropertyDefinitionBuilder<>::createProperty("User Password")
+      .withDescription("The user password to authenticate MiNiFi as a Couchbase client.")
+      .isSensitive(true)
+      .build();
+
+  EXTENSIONAPI static constexpr auto Properties = std::to_array<core::PropertyReference>({
+    ConnectionString,
+    UserName,
+    UserPassword
+  });
+
+
+  EXTENSIONAPI static constexpr bool SupportsDynamicProperties = false;
+  ADD_COMMON_VIRTUAL_FUNCTIONS_FOR_CONTROLLER_SERVICES
+
+  void initialize() override;
+
+  void yield() override {
+  };
+
+  bool isWorkAvailable() override {
+    return false;
+  };
+
+  bool isRunning() const override {
+    return getState() == core::controller::ControllerServiceState::ENABLED;
+  }
+
+  void onEnable() override;
+  void notifyStop() override {
+    if (client_) {
+      client_->close();
+    }
+  }
+
+  virtual nonstd::expected<CouchbaseUpsertResult, CouchbaseErrorType> upsert(const CouchbaseCollection& collection, CouchbaseValueType document_type,
+      const std::string& document_id, const std::vector<std::byte>& buffer, const ::couchbase::upsert_options& options) {
+    gsl_Expects(client_);
+    return client_->upsert(collection, document_type, document_id, buffer, options);
+  }
+
+  static gsl::not_null<std::shared_ptr<CouchbaseClusterService>> getFromProperty(const core::ProcessContext& context, const core::PropertyReference& property);
+
+ private:
+  std::unique_ptr<CouchbaseClient> client_;
+  std::shared_ptr<core::logging::Logger> logger_ = core::logging::LoggerFactory<CouchbaseClusterService>::getLogger(uuid_);
+};
+
+}  // namespace controllers
+}  // namespace org::apache::nifi::minifi::couchbase
diff --git a/extensions/couchbase/processors/PutCouchbaseKey.cpp b/extensions/couchbase/processors/PutCouchbaseKey.cpp
new file mode 100644
index 000000000..6f8ed54ce
--- /dev/null
+++ b/extensions/couchbase/processors/PutCouchbaseKey.cpp
@@ -0,0 +1,86 @@
+/**
+ *
+ * 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.
+ */
+
+#include "PutCouchbaseKey.h"
+#include "utils/gsl.h"
+#include "core/Resource.h"
+#include "utils/ProcessorConfigUtils.h"
+
+namespace org::apache::nifi::minifi::couchbase::processors {
+
+void PutCouchbaseKey::onSchedule(core::ProcessContext& context, core::ProcessSessionFactory&) {
+  couchbase_cluster_service_ = controllers::CouchbaseClusterService::getFromProperty(context, PutCouchbaseKey::CouchbaseClusterControllerService);
+  document_type_ = utils::parseEnumProperty<CouchbaseValueType>(context, PutCouchbaseKey::DocumentType);
+  persist_to_ = utils::parseEnumProperty<::couchbase::persist_to>(context, PutCouchbaseKey::PersistTo);
+  replicate_to_ = utils::parseEnumProperty<::couchbase::replicate_to>(context, PutCouchbaseKey::ReplicateTo);
+}
+
+void PutCouchbaseKey::onTrigger(core::ProcessContext& context, core::ProcessSession& session) {
+  gsl_Expects(couchbase_cluster_service_);
+
+  auto flow_file = session.get();
+  if (!flow_file) {
+    context.yield();
+    return;
+  }
+
+  CouchbaseCollection collection;
+  if (!context.getProperty(BucketName, collection.bucket_name, flow_file.get()) || collection.bucket_name.empty()) {
+    logger_->log_error("Bucket '{}' is invalid or empty!", collection.bucket_name);
+    session.transfer(flow_file, Failure);
+    return;
+  }
+
+  if (!context.getProperty(ScopeName, collection.scope_name, flow_file.get()) || collection.scope_name.empty()) {
+    collection.scope_name = ::couchbase::scope::default_name;
+  }
+
+  if (!context.getProperty(CollectionName, collection.collection_name, flow_file.get()) || collection.collection_name.empty()) {
+    collection.collection_name = ::couchbase::collection::default_name;
+  }
+
+  std::string document_id;
+  if (!context.getProperty(DocumentId, document_id, flow_file.get()) || document_id.empty()) {
+    document_id = flow_file->getAttribute(core::SpecialFlowAttribute::UUID).value_or(utils::IdGenerator::getIdGenerator()->generate().to_string());
+  }
+
+  ::couchbase::upsert_options options;
+  options.durability(persist_to_, replicate_to_);
+  auto result = session.readBuffer(flow_file);
+  if (auto upsert_result = couchbase_cluster_service_->upsert(collection, document_type_, document_id, result.buffer, options)) {
+    session.putAttribute(*flow_file, "couchbase.bucket", upsert_result->bucket_name);
+    session.putAttribute(*flow_file, "couchbase.doc.id", document_id);
+    session.putAttribute(*flow_file, "couchbase.doc.cas", std::to_string(upsert_result->cas));
+    session.putAttribute(*flow_file, "couchbase.doc.sequence.number", std::to_string(upsert_result->sequence_number));
+    session.putAttribute(*flow_file, "couchbase.partition.uuid", std::to_string(upsert_result->partition_uuid));
+    session.putAttribute(*flow_file, "couchbase.partition.id", std::to_string(upsert_result->partition_id));
+    session.transfer(flow_file, Success);
+  } else if (upsert_result.error() == CouchbaseErrorType::TEMPORARY) {
+    logger_->log_error("Failed to upsert document '{}' to collection '{}.{}.{}' due to temporary issue, transferring to retry relationship",
+      document_id, collection.bucket_name, collection.scope_name, collection.collection_name);
+    session.transfer(flow_file, Retry);
+  } else {
+    logger_->log_error("Failed to upsert document '{}' to collection '{}.{}.{}', transferring to failure relationship",
+      document_id, collection.bucket_name, collection.scope_name, collection.collection_name);
+    session.transfer(flow_file, Failure);
+  }
+}
+
+REGISTER_RESOURCE(PutCouchbaseKey, Processor);
+
+}  // namespace org::apache::nifi::minifi::couchbase::processors
diff --git a/extensions/couchbase/processors/PutCouchbaseKey.h b/extensions/couchbase/processors/PutCouchbaseKey.h
new file mode 100644
index 000000000..2b4f420af
--- /dev/null
+++ b/extensions/couchbase/processors/PutCouchbaseKey.h
@@ -0,0 +1,161 @@
+/**
+ *
+ * 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.
+ */
+#pragma once
+
+#include <memory>
+#include <string>
+#include <utility>
+
+#include "core/AbstractProcessor.h"
+#include "core/ProcessSession.h"
+#include "utils/Enum.h"
+#include "core/logging/LoggerConfiguration.h"
+#include "CouchbaseClusterService.h"
+#include "couchbase/persist_to.hxx"
+#include "couchbase/replicate_to.hxx"
+
+namespace magic_enum::customize {
+
+template <>
+constexpr customize_t enum_name<::couchbase::persist_to>(::couchbase::persist_to value) noexcept {
+  switch (value) {
+    case ::couchbase::persist_to::none:
+      return "NONE";
+    case ::couchbase::persist_to::active:
+      return "ACTIVE";
+    case ::couchbase::persist_to::one:
+      return "ONE";
+    case ::couchbase::persist_to::two:
+      return "TWO";
+    case ::couchbase::persist_to::three:
+      return "THREE";
+    case ::couchbase::persist_to::four:
+      return "FOUR";
+  }
+  return invalid_tag;
+}
+
+template <>
+constexpr customize_t enum_name<::couchbase::replicate_to>(::couchbase::replicate_to value) noexcept {
+  switch (value) {
+    case ::couchbase::replicate_to::none:
+      return "NONE";
+    case ::couchbase::replicate_to::one:
+      return "ONE";
+    case ::couchbase::replicate_to::two:
+      return "TWO";
+    case ::couchbase::replicate_to::three:
+      return "THREE";
+  }
+  return invalid_tag;
+}
+}  // namespace magic_enum::customize
+
+namespace org::apache::nifi::minifi::couchbase::processors {
+
+class PutCouchbaseKey final : public core::AbstractProcessor<PutCouchbaseKey> {
+ public:
+  using core::AbstractProcessor<PutCouchbaseKey>::AbstractProcessor;
+
+  EXTENSIONAPI static constexpr const char* Description = "Put a document to Couchbase Server via Key/Value access.";
+
+  EXTENSIONAPI static constexpr auto CouchbaseClusterControllerService = core::PropertyDefinitionBuilder<>::createProperty("Couchbase Cluster Controller Service")
+      .withDescription("A Couchbase Cluster Controller Service which manages connections to a Couchbase cluster.")
+      .withAllowedTypes<controllers::CouchbaseClusterService>()
+      .isRequired(true)
+      .build();
+  EXTENSIONAPI static constexpr auto BucketName = core::PropertyDefinitionBuilder<>::createProperty("Bucket Name")
+      .withDescription("The name of bucket to access.")
+      .withDefaultValue("default")
+      .isRequired(true)
+      .supportsExpressionLanguage(true)
+      .build();
+  EXTENSIONAPI static constexpr auto ScopeName = core::PropertyDefinitionBuilder<>::createProperty("Scope Name")
+      .withDescription("Scope to use inside the bucket. If not specified, the _default scope is used.")
+      .supportsExpressionLanguage(true)
+      .build();
+  EXTENSIONAPI static constexpr auto CollectionName = core::PropertyDefinitionBuilder<>::createProperty("Collection Name")
+      .withDescription("Collection to use inside the bucket scope. If not specified, the _default collection is used.")
+      .supportsExpressionLanguage(true)
+      .build();
+  EXTENSIONAPI static constexpr auto DocumentType = core::PropertyDefinitionBuilder<magic_enum::enum_count<CouchbaseValueType>()>::createProperty("Document Type")
+      .withDescription("Content type to store data as.")
+      .isRequired(true)
+      .withDefaultValue(magic_enum::enum_name(CouchbaseValueType::Json))
+      .withAllowedValues(magic_enum::enum_names<CouchbaseValueType>())
+      .build();
+  EXTENSIONAPI static constexpr auto DocumentId = core::PropertyDefinitionBuilder<>::createProperty("Document Id")
+      .withDescription("A static, fixed Couchbase document id, or an expression to construct the Couchbase document id. "
+                       "If not specified, either the FlowFile uuid attribute or if that's not found a generated uuid will be used.")
+      .supportsExpressionLanguage(true)
+      .build();
+  EXTENSIONAPI static constexpr auto PersistTo = core::PropertyDefinitionBuilder<6>::createProperty("Persist To")
+      .withDescription("Durability constraint about disk persistence.")
+      .isRequired(true)
+      .withDefaultValue(magic_enum::enum_name(::couchbase::persist_to::none))
+      .withAllowedValues(magic_enum::enum_names<::couchbase::persist_to>())
+      .build();
+  EXTENSIONAPI static constexpr auto ReplicateTo = core::PropertyDefinitionBuilder<4>::createProperty("Replicate To")
+      .withDescription("Durability constraint about replication.")
+      .isRequired(true)
+      .withDefaultValue(magic_enum::enum_name(::couchbase::replicate_to::none))
+      .withAllowedValues(magic_enum::enum_names<::couchbase::replicate_to>())
+      .build();
+
+  EXTENSIONAPI static constexpr auto Properties = std::to_array<core::PropertyReference>({
+    CouchbaseClusterControllerService,
+    BucketName,
+    ScopeName,
+    CollectionName,
+    DocumentType,
+    DocumentId,
+    PersistTo,
+    ReplicateTo
+  });
+
+  EXTENSIONAPI static constexpr auto Success = core::RelationshipDefinition{"success", "All FlowFiles that are written to Couchbase Server are routed to this relationship."};
+  EXTENSIONAPI static constexpr auto Failure = core::RelationshipDefinition{"failure", "All FlowFiles failed to be written to Couchbase Server and not retry-able are routed to this relationship."};
+  EXTENSIONAPI static constexpr auto Retry = core::RelationshipDefinition{"retry", "All FlowFiles failed to be written to Couchbase Server but can be retried are routed to this relationship."};
+  EXTENSIONAPI static constexpr auto Relationships = std::array{Success, Failure, Retry};
+
+  EXTENSIONAPI static constexpr auto CouchbaseBucket = core::OutputAttributeDefinition<>{"couchbase.bucket", {Success}, "Bucket where the document was stored."};
+  EXTENSIONAPI static constexpr auto CouchbaseDocId = core::OutputAttributeDefinition<>{"couchbase.doc.id", {Success}, "Id of the document."};
+  EXTENSIONAPI static constexpr auto CouchbaseDocCas = core::OutputAttributeDefinition<>{"couchbase.doc.cas", {Success}, "CAS of the document."};
+  EXTENSIONAPI static constexpr auto CouchbaseDocSequenceNumber = core::OutputAttributeDefinition<>{"couchbase.doc.sequence.number", {Success}, "Sequence number associated with the document."};
+  EXTENSIONAPI static constexpr auto CouchbasePartitionUUID = core::OutputAttributeDefinition<>{"couchbase.partition.uuid", {Success}, "UUID of partition."};
+  EXTENSIONAPI static constexpr auto CouchbasePartitionId = core::OutputAttributeDefinition<>{"couchbase.partition.id", {Success}, "ID of partition (also known as vBucket)."};
+  EXTENSIONAPI static constexpr auto OutputAttributes = std::array<core::OutputAttributeReference, 6>{
+      CouchbaseBucket, CouchbaseDocId, CouchbaseDocCas, CouchbaseDocSequenceNumber, CouchbasePartitionUUID, CouchbasePartitionId};
+
+  EXTENSIONAPI static constexpr bool SupportsDynamicProperties = false;
+  EXTENSIONAPI static constexpr bool SupportsDynamicRelationships = false;
+  EXTENSIONAPI static constexpr core::annotation::Input InputRequirement = core::annotation::Input::INPUT_REQUIRED;
+  EXTENSIONAPI static constexpr bool IsSingleThreaded = false;
+
+  void onSchedule(core::ProcessContext& context, core::ProcessSessionFactory& sessionFactory) override;
+  void onTrigger(core::ProcessContext& context, core::ProcessSession& session) override;
+
+ private:
+  std::shared_ptr<controllers::CouchbaseClusterService> couchbase_cluster_service_;
+  std::shared_ptr<core::logging::Logger> logger_ = core::logging::LoggerFactory<PutCouchbaseKey>::getLogger(uuid_);
+  CouchbaseValueType document_type_ = CouchbaseValueType::Json;
+  ::couchbase::persist_to persist_to_ = ::couchbase::persist_to::none;
+  ::couchbase::replicate_to replicate_to_ = ::couchbase::replicate_to::none;
+};
+
+}  // namespace org::apache::nifi::minifi::couchbase::processors
diff --git a/extensions/couchbase/tests/CMakeLists.txt b/extensions/couchbase/tests/CMakeLists.txt
new file mode 100644
index 000000000..18caaeff0
--- /dev/null
+++ b/extensions/couchbase/tests/CMakeLists.txt
@@ -0,0 +1,39 @@
+#
+# 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.
+#
+
+file(GLOB COUCHBASE_TESTS  "*.cpp")
+
+SET(COUCHBASE_TEST_COUNT 0)
+FOREACH(testfile ${COUCHBASE_TESTS})
+    get_filename_component(testfilename "${testfile}" NAME_WE)
+    add_minifi_executable("${testfilename}" "${testfile}")
+    target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
+    target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/couchbase/controllerservices")
+    target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/couchbase/processors")
+    target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/couchbase/")
+    target_include_directories(${testfilename} PRIVATE BEFORE "${COUCHBASE_INCLUDE_DIR}")
+
+    createTests("${testfilename}")
+    target_link_libraries(${testfilename} Catch2WithMain)
+    target_link_libraries(${testfilename} minifi-couchbase)
+    target_link_libraries(${testfilename} minifi-standard-processors)
+    MATH(EXPR COUCHBASE_TEST_COUNT "${COUCHBASE_TEST_COUNT}+1")
+    add_test(NAME "${testfilename}" COMMAND "${testfilename}" WORKING_DIRECTORY ${TEST_DIR})
+ENDFOREACH()
+message("-- Finished building ${COUCHBASE_TEST_COUNT} Couchbase related test file(s)...")
diff --git a/extensions/couchbase/tests/MockCouchbaseClusterService.h b/extensions/couchbase/tests/MockCouchbaseClusterService.h
new file mode 100644
index 000000000..a2757f16c
--- /dev/null
+++ b/extensions/couchbase/tests/MockCouchbaseClusterService.h
@@ -0,0 +1,81 @@
+/**
+ * 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.
+ */
+
+#pragma once
+#include <utility>
+#include <string>
+#include "CouchbaseClusterService.h"
+#include "unit/Catch.h"
+
+using namespace std::literals::chrono_literals;
+
+namespace org::apache::nifi::minifi::couchbase::test {
+
+const std::uint64_t COUCHBASE_PUT_RESULT_CAS = 9876;
+const std::uint64_t COUCHBASE_PUT_RESULT_SEQUENCE_NUMBER = 345;
+const std::uint64_t COUCHBASE_PUT_RESULT_PARTITION_UUID = 7890123456;
+const std::uint16_t COUCHBASE_PUT_RESULT_PARTITION_ID = 1234;
+
+struct UpsertParameters {
+  CouchbaseValueType document_type;
+  std::string document_id;
+  std::vector<std::byte> buffer;
+  ::couchbase::upsert_options options;
+};
+
+class MockCouchbaseClusterService : public controllers::CouchbaseClusterService {
+ public:
+  using CouchbaseClusterService::CouchbaseClusterService;
+  EXTENSIONAPI static constexpr bool SupportsDynamicProperties = false;
+  ADD_COMMON_VIRTUAL_FUNCTIONS_FOR_CONTROLLER_SERVICES
+
+  void onEnable() override {}
+  void notifyStop() override {}
+
+  nonstd::expected<CouchbaseUpsertResult, CouchbaseErrorType> upsert(const CouchbaseCollection& collection, CouchbaseValueType document_type, const std::string& document_id,
+      const std::vector<std::byte>& buffer, const ::couchbase::upsert_options& options) override {
+    collection_ = collection;
+    upsert_parameters_.document_type = document_type;
+    upsert_parameters_.document_id = document_id;
+    upsert_parameters_.buffer = buffer;
+    upsert_parameters_.options = options;
+
+    if (upsert_error_) {
+      return nonstd::make_unexpected(*upsert_error_);
+    } else {
+      return CouchbaseUpsertResult{collection_.bucket_name, COUCHBASE_PUT_RESULT_CAS, COUCHBASE_PUT_RESULT_SEQUENCE_NUMBER, COUCHBASE_PUT_RESULT_PARTITION_UUID, COUCHBASE_PUT_RESULT_PARTITION_ID};
+    }
+  }
+
+  UpsertParameters getUpsertParameters() const {
+    return upsert_parameters_;
+  }
+
+  CouchbaseCollection getCollectionParameter() const {
+    return collection_;
+  }
+
+  void setUpsertError(const CouchbaseErrorType upsert_error) {
+    upsert_error_ = upsert_error;
+  }
+
+ private:
+  CouchbaseCollection collection_;
+  UpsertParameters upsert_parameters_;
+  std::optional<CouchbaseErrorType> upsert_error_;
+};
+}  // namespace org::apache::nifi::minifi::couchbase::test
diff --git a/extensions/couchbase/tests/PutCouchbaseKeyTests.cpp b/extensions/couchbase/tests/PutCouchbaseKeyTests.cpp
new file mode 100644
index 000000000..84afe362b
--- /dev/null
+++ b/extensions/couchbase/tests/PutCouchbaseKeyTests.cpp
@@ -0,0 +1,172 @@
+/**
+ *
+ * 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.
+ */
+
+#include "unit/TestBase.h"
+#include "unit/Catch.h"
+#include "unit/SingleProcessorTestController.h"
+#include "processors/PutCouchbaseKey.h"
+#include "MockCouchbaseClusterService.h"
+#include "core/Resource.h"
+
+namespace org::apache::nifi::minifi::couchbase::test {
+
+REGISTER_RESOURCE(MockCouchbaseClusterService, ControllerService);
+
+const std::string TEST_UUID = "a53f0e78-b91a-4a82-939b-639174edb00b";
+
+struct ExpectedCallOptions {
+  std::string bucket_name;
+  std::string scope_name;
+  std::string collection_name;
+  ::couchbase::persist_to persist_to;
+  ::couchbase::replicate_to replicate_to;
+  CouchbaseValueType document_type;
+  std::string doc_id;
+};
+
+class PutCouchbaseKeyTestController : public TestController {
+ public:
+  PutCouchbaseKeyTestController()
+      : controller_(std::make_unique<processors::PutCouchbaseKey>("PutCouchbaseKey")),
+        proc_(controller_.getProcessor()) {
+    LogTestController::getInstance().setDebug<TestPlan>();
+    LogTestController::getInstance().setDebug<minifi::core::Processor>();
+    LogTestController::getInstance().setTrace<minifi::core::ProcessSession>();
+    LogTestController::getInstance().setDebug<controllers::CouchbaseClusterService>();
+    LogTestController::getInstance().setDebug<processors::PutCouchbaseKey>();
+    auto controller_service_node = controller_.plan->addController("MockCouchbaseClusterService", "MockCouchbaseClusterService");
+    mock_couchbase_cluster_service_ = std::static_pointer_cast<MockCouchbaseClusterService>(controller_service_node->getControllerServiceImplementation());
+    proc_->setProperty(processors::PutCouchbaseKey::CouchbaseClusterControllerService, "MockCouchbaseClusterService");
+  }
+
+  [[nodiscard]] static std::vector<std::byte> stringToByteVector(const std::string& str) {
+    std::vector<std::byte> byte_vector;
+    byte_vector.reserve(str.size());
+    for (char ch : str) {
+      byte_vector.push_back(static_cast<std::byte>(ch));
+    }
+    return byte_vector;
+  }
+
+  void verifyResults(const minifi::test::ProcessorTriggerResult& results, const minifi::core::Relationship& expected_result, const ExpectedCallOptions& expected_call_options,
+      const std::string& input) const {
+    std::shared_ptr<core::FlowFile> flow_file;
+    if (expected_result == processors::PutCouchbaseKey::Success) {
+      REQUIRE(results.at(processors::PutCouchbaseKey::Success).size() == 1);
+      REQUIRE(results.at(processors::PutCouchbaseKey::Failure).empty());
+      REQUIRE(results.at(processors::PutCouchbaseKey::Retry).empty());
+      flow_file = results.at(processors::PutCouchbaseKey::Success)[0];
+    } else if (expected_result == processors::PutCouchbaseKey::Failure) {
+      REQUIRE(results.at(processors::PutCouchbaseKey::Success).empty());
+      REQUIRE(results.at(processors::PutCouchbaseKey::Failure).size() == 1);
+      REQUIRE(results.at(processors::PutCouchbaseKey::Retry).empty());
+      flow_file = results.at(processors::PutCouchbaseKey::Failure)[0];
+      REQUIRE(LogTestController::getInstance().contains("Failed to upsert document", 1s));
+    } else {
+      REQUIRE(results.at(processors::PutCouchbaseKey::Success).empty());
+      REQUIRE(results.at(processors::PutCouchbaseKey::Failure).empty());
+      REQUIRE(results.at(processors::PutCouchbaseKey::Retry).size() == 1);
+      flow_file = results.at(processors::PutCouchbaseKey::Retry)[0];
+    }
+
+    auto get_collection_parameters = mock_couchbase_cluster_service_->getCollectionParameter();
+    CHECK(get_collection_parameters.bucket_name == expected_call_options.bucket_name);
+    CHECK(get_collection_parameters.collection_name == expected_call_options.collection_name);
+    CHECK(get_collection_parameters.scope_name == expected_call_options.scope_name);
+
+    auto upsert_parameters = mock_couchbase_cluster_service_->getUpsertParameters();
+    CHECK(upsert_parameters.document_type == expected_call_options.document_type);
+    auto expected_doc_id = expected_call_options.doc_id.empty() ? TEST_UUID : expected_call_options.doc_id;
+    CHECK(upsert_parameters.document_id == expected_doc_id);
+    CHECK(upsert_parameters.buffer == stringToByteVector(input));
+
+    auto upsert_options = upsert_parameters.options.build();
+    CHECK(upsert_options.persist_to == expected_call_options.persist_to);
+    CHECK(upsert_options.replicate_to == expected_call_options.replicate_to);
+
+    if (expected_result != processors::PutCouchbaseKey::Success) {
+      return;
+    }
+
+    CHECK(flow_file->getAttribute("couchbase.bucket").value() == expected_call_options.bucket_name);
+    CHECK(flow_file->getAttribute("couchbase.doc.id").value() == expected_doc_id);
+    CHECK(flow_file->getAttribute("couchbase.doc.cas").value() == std::to_string(COUCHBASE_PUT_RESULT_CAS));
+    CHECK(flow_file->getAttribute("couchbase.doc.sequence.number").value() == std::to_string(COUCHBASE_PUT_RESULT_SEQUENCE_NUMBER));
+    CHECK(flow_file->getAttribute("couchbase.partition.uuid").value() == std::to_string(COUCHBASE_PUT_RESULT_PARTITION_UUID));
+    CHECK(flow_file->getAttribute("couchbase.partition.id").value() == std::to_string(COUCHBASE_PUT_RESULT_PARTITION_ID));
+  }
+
+ protected:
+  minifi::test::SingleProcessorTestController controller_;
+  core::Processor* proc_ = nullptr;
+  std::shared_ptr<MockCouchbaseClusterService> mock_couchbase_cluster_service_;
+};
+
+TEST_CASE_METHOD(PutCouchbaseKeyTestController, "Invalid Couchbase cluster controller service", "[putcouchbasekey]") {
+  proc_->setProperty(processors::PutCouchbaseKey::CouchbaseClusterControllerService, "invalid");
+  REQUIRE_THROWS_AS(controller_.trigger({minifi::test::InputFlowFileData{"{\"name\": \"John\"}\n{\"name\": \"Jill\"}", {{"uuid", TEST_UUID}}}}), minifi::Exception);
+}
+
+TEST_CASE_METHOD(PutCouchbaseKeyTestController, "Invalid bucket name", "[putcouchbasekey]") {
+  proc_->setProperty(processors::PutCouchbaseKey::BucketName, "");
+  auto results = controller_.trigger({minifi::test::InputFlowFileData{"{\"name\": \"John\"}\n{\"name\": \"Jill\"}", {{"uuid", TEST_UUID}}}});
+  REQUIRE(results[processors::PutCouchbaseKey::Failure].size() == 1);
+  REQUIRE(LogTestController::getInstance().contains("Bucket '' is invalid or empty!", 1s));
+}
+
+TEST_CASE_METHOD(PutCouchbaseKeyTestController, "Put succeeeds with default properties", "[putcouchbasekey]") {
+  proc_->setProperty(processors::PutCouchbaseKey::BucketName, "mybucket");
+  const std::string input = "{\"name\": \"John\"}\n{\"name\": \"Jill\"}";
+  auto results = controller_.trigger({minifi::test::InputFlowFileData{input, {{"uuid", TEST_UUID}}}});
+  verifyResults(results, processors::PutCouchbaseKey::Success, ExpectedCallOptions{"mybucket", "_default", "_default",
+    ::couchbase::persist_to::none, ::couchbase::replicate_to::none, CouchbaseValueType::Json, ""}, input);
+}
+
+TEST_CASE_METHOD(PutCouchbaseKeyTestController, "Put succeeeds with optional properties", "[putcouchbasekey]") {
+  proc_->setProperty(processors::PutCouchbaseKey::BucketName, "mybucket");
+  proc_->setProperty(processors::PutCouchbaseKey::ScopeName, "scope1");
+  proc_->setProperty(processors::PutCouchbaseKey::CollectionName, "collection1");
+  proc_->setProperty(processors::PutCouchbaseKey::DocumentType, "Binary");
+  proc_->setProperty(processors::PutCouchbaseKey::DocumentId, "important_doc");
+  proc_->setProperty(processors::PutCouchbaseKey::PersistTo, "ACTIVE");
+  proc_->setProperty(processors::PutCouchbaseKey::ReplicateTo, "TWO");
+  const std::string input = "{\"name\": \"John\"}\n{\"name\": \"Jill\"}";
+  auto results = controller_.trigger({minifi::test::InputFlowFileData{input, {{"uuid", TEST_UUID}}}});
+  verifyResults(results, processors::PutCouchbaseKey::Success, ExpectedCallOptions{"mybucket", "scope1", "collection1", ::couchbase::persist_to::active,
+    ::couchbase::replicate_to::two, CouchbaseValueType::Binary, "important_doc"}, input);
+}
+
+TEST_CASE_METHOD(PutCouchbaseKeyTestController, "Put fails with default properties", "[putcouchbasekey]") {
+  proc_->setProperty(processors::PutCouchbaseKey::BucketName, "mybucket");
+  mock_couchbase_cluster_service_->setUpsertError(CouchbaseErrorType::FATAL);
+  const std::string input = "{\"name\": \"John\"}\n{\"name\": \"Jill\"}";
+  auto results = controller_.trigger({minifi::test::InputFlowFileData{input, {{"uuid", TEST_UUID}}}});
+  verifyResults(results, processors::PutCouchbaseKey::Failure, ExpectedCallOptions{"mybucket", "_default", "_default", ::couchbase::persist_to::none, ::couchbase::replicate_to::none,
+    CouchbaseValueType::Json, ""}, input);
+}
+
+TEST_CASE_METHOD(PutCouchbaseKeyTestController, "FlowFile is transferred to retry relationship when temporary error is returned", "[putcouchbasekey]") {
+  proc_->setProperty(processors::PutCouchbaseKey::BucketName, "mybucket");
+  mock_couchbase_cluster_service_->setUpsertError(CouchbaseErrorType::TEMPORARY);
+  const std::string input = "{\"name\": \"John\"}\n{\"name\": \"Jill\"}";
+  auto results = controller_.trigger({minifi::test::InputFlowFileData{input, {{"uuid", TEST_UUID}}}});
+  verifyResults(results, processors::PutCouchbaseKey::Retry, ExpectedCallOptions{"mybucket", "_default", "_default", ::couchbase::persist_to::none, ::couchbase::replicate_to::none,
+    CouchbaseValueType::Json, ""}, input);
+}
+
+}  // namespace org::apache::nifi::minifi::couchbase::test
diff --git a/libminifi/include/Exception.h b/libminifi/include/Exception.h
index dff108d84..77756272f 100644
--- a/libminifi/include/Exception.h
+++ b/libminifi/include/Exception.h
@@ -47,7 +47,7 @@ enum ExceptionType {
 };
 
 static const char *ExceptionStr[MAX_EXCEPTION] = { "File Operation", "Flow File Operation", "Processor Operation", "Process Session Operation", "Process Schedule Operation", "Site2Site Protocol",
-    "General Operation", "Regex Operation", "Repository Operation", "Parameter Operation"};
+    "General Operation", "Regex Operation", "Repository Operation", "Parameter Operation" };
 
 inline const char *ExceptionTypeToString(ExceptionType type) {
   if (type < MAX_EXCEPTION)
diff --git a/libminifi/include/utils/SmallString.h b/libminifi/include/utils/SmallString.h
index 2ff5dd9b6..edf9466d2 100644
--- a/libminifi/include/utils/SmallString.h
+++ b/libminifi/include/utils/SmallString.h
@@ -100,7 +100,7 @@ struct fmt::formatter<org::apache::nifi::minifi::utils::SmallString<N>> {
   }
 
   template <typename FormatContext>
-  auto format(const org::apache::nifi::minifi::utils::SmallString<N>& small_string, FormatContext& ctx) {
+  auto format(const org::apache::nifi::minifi::utils::SmallString<N>& small_string, FormatContext& ctx) const {
     return string_view_formatter.format(small_string.view(), ctx);
   }
 };
diff --git a/thirdparty/bustache/add-append.patch b/thirdparty/bustache/add-append.patch
new file mode 100644
index 000000000..d77ebaeca
--- /dev/null
+++ b/thirdparty/bustache/add-append.patch
@@ -0,0 +1,18 @@
+diff --git a/include/bustache/model.hpp b/include/bustache/model.hpp
+index 575969a..07bc89d 100644
+--- a/include/bustache/model.hpp
++++ b/include/bustache/model.hpp
+@@ -330,6 +330,13 @@ namespace bustache::detail
+             buf[count++] = c;
+         }
+ 
++        void append(const char* const begin, const char* const end)
++        {
++            for (const char* it = begin; it != end; ++it) {
++                push_back(*it);
++            }
++        }
++
+         void flush() { os(buf, count); }
+ 
+         std::size_t count = 0;
diff --git a/thirdparty/couchbase/remove-thirdparty.patch b/thirdparty/couchbase/remove-thirdparty.patch
new file mode 100644
index 000000000..732576f14
--- /dev/null
+++ b/thirdparty/couchbase/remove-thirdparty.patch
@@ -0,0 +1,172 @@
+diff --git a/cmake/ThirdPartyDependencies.cmake b/cmake/ThirdPartyDependencies.cmake
+index f02af02..f83c181 100644
+--- a/cmake/ThirdPartyDependencies.cmake
++++ b/cmake/ThirdPartyDependencies.cmake
+@@ -3,73 +3,30 @@
+ include(cmake/CPM.cmake)
+ 
+ # https://cmake.org/cmake/help/v3.28/policy/CMP0063.html
+ set(CMAKE_POLICY_DEFAULT_CMP0063 NEW)
+ 
+ function(declare_system_library target)
+   message(STATUS "Declaring system library ${target}")
+   get_target_property(target_aliased_name ${target} ALIASED_TARGET)
+   if(target_aliased_name)
+     set(target ${target_aliased_name})
+   endif()
+   set_target_properties(${target} PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES
+                                              $<TARGET_PROPERTY:${target},INTERFACE_INCLUDE_DIRECTORIES>)
+ endfunction()
+ 
+-if(NOT TARGET fmt::fmt)
+-  # https://github.com/fmtlib/fmt/releases
+-  cpmaddpackage(
+-    NAME
+-    fmt
+-    GIT_TAG
+-    11.0.1
+-    VERSION
+-    11.0.1
+-    GITHUB_REPOSITORY
+-    "fmtlib/fmt"
+-    EXCLUDE_FROM_ALL ON
+-    OPTIONS
+-    "FMT_INSTALL OFF"
+-    # Unicode support for MSVC enabled in CompilerWarnings.cmake
+-    "FMT_UNICODE OFF"
+-    "FMT_DOC OFF"
+-    "BUILD_SHARED_LIBS OFF"
+-    "CMAKE_C_VISIBILITY_PRESET hidden"
+-    "CMAKE_CXX_VISIBILITY_PRESET hidden"
+-    "CMAKE_POSITION_INDEPENDENT_CODE ON")
+-endif()
+-
+-if(NOT TARGET spdlog::spdlog)
+-  # https://github.com/gabime/spdlog/releases
+-  cpmaddpackage(
+-    NAME
+-    spdlog
+-    VERSION
+-    1.14.1
+-    GITHUB_REPOSITORY
+-    "gabime/spdlog"
+-    EXCLUDE_FROM_ALL ON
+-    OPTIONS
+-    "SPDLOG_INSTALL OFF"
+-    "BUILD_SHARED_LIBS OFF"
+-    "CMAKE_C_VISIBILITY_PRESET hidden"
+-    "CMAKE_CXX_VISIBILITY_PRESET hidden"
+-    "CMAKE_POSITION_INDEPENDENT_CODE ON"
+-    "SPDLOG_BUILD_SHARED OFF"
+-    "SPDLOG_FMT_EXTERNAL ON")
+-endif()
+-
+ if(NOT TARGET Microsoft.GSL::GSL)
+   # https://github.com/microsoft/GSL/releases
+   cpmaddpackage(
+     NAME
+     gsl
+     VERSION
+     4.0.0
+     GITHUB_REPOSITORY
+     "microsoft/gsl"
+     EXCLUDE_FROM_ALL ON
+     OPTIONS
+     "GSL_INSTALL OFF"
+     "CMAKE_C_VISIBILITY_PRESET hidden"
+     "CMAKE_CXX_VISIBILITY_PRESET hidden"
+     "CMAKE_POSITION_INDEPENDENT_CODE ON")
+@@ -159,93 +116,24 @@ if(NOT TARGET taocpp::json)
+     "CMAKE_POSITION_INDEPENDENT_CODE ON"
+     "BUILD_SHARED_LIBS OFF"
+     "PEGTL_INSTALL ${COUCHBASE_CXX_CLIENT_INSTALL}"
+     "PEGTL_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/pegtl"
+     "PEGTL_INSTALL_DOC_DIR ${CMAKE_INSTALL_DATAROOTDIR}/doc/tao/pegtl"
+     "PEGTL_BUILD_TESTS OFF"
+     "PEGTL_BUILD_EXAMPLES OFF"
+     "PEGTL_USE_BOOST_FILESYSTEM OFF"
+     "TAOCPP_JSON_INSTALL ${COUCHBASE_CXX_CLIENT_INSTALL}"
+     "TAOCPP_JSON_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/taocpp-json"
+     "TAOCPP_JSON_INSTALL_DOC_DIR ${CMAKE_INSTALL_DATAROOTDIR}/doc/tao/json"
+     "TAOCPP_JSON_BUILD_TESTS OFF"
+     "TAOCPP_JSON_BUILD_EXAMPLES OFF")
+ endif()
+ 
+-
+-if(NOT TARGET asio::asio)
+-  # https://github.com/chriskohlhoff/asio/tags
+-  cpmaddpackage(
+-    NAME
+-    asio
+-    GIT_TAG
+-    asio-1-31-0
+-    VERSION
+-    1.31.0
+-    GITHUB_REPOSITORY
+-    "chriskohlhoff/asio"
+-    EXCLUDE_FROM_ALL ON)
+-endif()
+-
+-# ASIO doesn't use CMake, we have to configure it manually. Extra notes for using on Windows:
+-#
+-# 1) If _WIN32_WINNT is not set, ASIO assumes _WIN32_WINNT=0x0501, i.e. Windows XP target, which is definitely not the
+-# platform which most users target.
+-#
+-# 2) WIN32_LEAN_AND_MEAN is defined to make Winsock2 work.
+-if(asio_ADDED)
+-  add_library(asio STATIC ${asio_SOURCE_DIR}/asio/src/asio.cpp ${asio_SOURCE_DIR}/asio/src/asio_ssl.cpp)
+-
+-  target_include_directories(asio SYSTEM PUBLIC ${asio_SOURCE_DIR}/asio/include)
+-  target_compile_definitions(asio PRIVATE ASIO_STANDALONE=1 ASIO_NO_DEPRECATED=1 ASIO_SEPARATE_COMPILATION=1)
+-  target_link_libraries(asio PRIVATE Threads::Threads OpenSSL::SSL OpenSSL::Crypto)
+-  set_target_properties(
+-    asio
+-    PROPERTIES C_VISIBILITY_PRESET hidden
+-               CXX_VISIBILITY_PRESET hidden
+-               POSITION_INDEPENDENT_CODE TRUE)
+-
+-  if(WIN32)
+-    # macro see @ https://stackoverflow.com/a/40217291/1746503
+-    macro(get_win32_winnt version)
+-      if(CMAKE_SYSTEM_VERSION)
+-        set(ver ${CMAKE_SYSTEM_VERSION})
+-        string(REGEX MATCH "^([0-9]+).([0-9])" ver ${ver})
+-        string(REGEX MATCH "^([0-9]+)" verMajor ${ver})
+-        # Check for Windows 10, b/c we'll need to convert to hex 'A'.
+-        if("${verMajor}" MATCHES "10")
+-          set(verMajor "A")
+-          string(REGEX REPLACE "^([0-9]+)" ${verMajor} ver ${ver})
+-        endif("${verMajor}" MATCHES "10")
+-        # Remove all remaining '.' characters.
+-        string(REPLACE "." "" ver ${ver})
+-        # Prepend each digit with a zero.
+-        string(REGEX REPLACE "([0-9A-Z])" "0\\1" ver ${ver})
+-        set(${version} "0x${ver}")
+-      endif()
+-    endmacro()
+-
+-    if(NOT DEFINED _WIN32_WINNT)
+-      get_win32_winnt(ver)
+-      set(_WIN32_WINNT ${ver})
+-    endif()
+-
+-    message(STATUS "Set _WIN32_WINNT=${_WIN32_WINNT}")
+-
+-    target_compile_definitions(asio INTERFACE _WIN32_WINNT=${_WIN32_WINNT} WIN32_LEAN_AND_MEAN)
+-  endif()
+-
+-  add_library(asio::asio ALIAS asio)
+-endif()
+-
+ add_library(jsonsl OBJECT ${PROJECT_SOURCE_DIR}/third_party/jsonsl/jsonsl.c)
+ set_target_properties(jsonsl PROPERTIES C_VISIBILITY_PRESET hidden POSITION_INDEPENDENT_CODE TRUE)
+ target_include_directories(jsonsl SYSTEM PUBLIC ${PROJECT_SOURCE_DIR}/third_party/jsonsl)
+ 
+ declare_system_library(snappy)
+ declare_system_library(llhttp::llhttp)
+ declare_system_library(hdr_histogram_static)
+ declare_system_library(Microsoft.GSL::GSL)
+-declare_system_library(spdlog::spdlog)
+-declare_system_library(fmt::fmt)
+-declare_system_library(asio)
+ declare_system_library(taocpp::json)
diff --git a/win_build_vs.bat b/win_build_vs.bat
index a0058a6d7..f0699b885 100644
--- a/win_build_vs.bat
+++ b/win_build_vs.bat
@@ -45,6 +45,7 @@ set enable_prometheus=ON
 set enable_gcp=ON
 set enable_elastic=ON
 set enable_grafana_loki=OFF
+set enable_couchbase=OFF
 set test_custom_wel_provider=OFF
 set generator="Visual Studio 17 2022"
 set cpack=OFF
@@ -83,6 +84,7 @@ for %%x in (%*) do (
     if [%%~x] EQU [/NO_OPS]           set enable_ops=OFF
     if [%%~x] EQU [/NO_PYTHON_SCRIPTING] set enable_python_scripting=OFF
     if [%%~x] EQU [/LOKI]             set enable_grafana_loki=ON
+    if [%%~x] EQU [/COUCHBASE]        set enable_couchbase=ON
     if [%%~x] EQU [/32]               set build_platform=Win32
     if [%%~x] EQU [/D]                set cmake_build_type=RelWithDebInfo
     if [%%~x] EQU [/DD]               set cmake_build_type=Debug
@@ -111,7 +113,7 @@ cmake -G %generator% %build_platform_cmd% -DMINIFI_INCLUDE_VC_REDIST_MERGE_MODUL
         -DENABLE_OPENCV=%enable_opencv% -DENABLE_PROMETHEUS=%enable_prometheus% -DENABLE_ELASTICSEARCH=%enable_elastic% -DUSE_SHARED_LIBS=OFF -DENABLE_CONTROLLER=OFF  ^
         -DENABLE_BUSTACHE=%enable_bustache% -DENABLE_ENCRYPT_CONFIG=%enable_encrypt_config% -DENABLE_LUA_SCRIPTING=%enable_lua_scripting% -DENABLE_SMB=%enable_smb% ^
         -DENABLE_MQTT=%enable_mqtt% -DENABLE_OPC=%enable_opc% -DENABLE_OPS=%enable_ops% ^
-        -DENABLE_PYTHON_SCRIPTING=%enable_python_scripting% -DENABLE_GRAFANA_LOKI=%enable_grafana_loki% ^
+        -DENABLE_PYTHON_SCRIPTING=%enable_python_scripting% -DENABLE_GRAFANA_LOKI=%enable_grafana_loki% -DENABLE_COUCHBASE=%enable_couchbase% ^
         -DBUILD_ROCKSDB=ON -DUSE_SYSTEM_UUID=OFF -DENABLE_LIBARCHIVE=ON -DENABLE_WEL=ON -DMINIFI_FAIL_ON_WARNINGS=OFF -DSKIP_TESTS=%skiptests% -DMINIFI_INCLUDE_VC_REDIST_DLLS=%vc_redist% ^
         %strict_gsl_checks% -DMINIFI_INCLUDE_UCRT_DLLS=%ucrt% %sccache_arg% %EXTRA_CMAKE_ARGUMENTS% "%scriptdir%" && %buildcmd%
 IF %ERRORLEVEL% NEQ 0 EXIT /b %ERRORLEVEL%


(nifi-minifi-cpp) 04/04: MINIFICPP-2479 Update librdkafka and add lz4, zstd support

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

szaszm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit d6dcc24ed903f14f85d6d8a0eb940563a0f8ec66
Author: Martin Zink <ma...@apache.org>
AuthorDate: Wed Nov 27 13:22:53 2024 +0100

    MINIFICPP-2479 Update librdkafka and add lz4, zstd support
    
    Closes #1885
    
    Signed-off-by: Marton Szasz <sz...@apache.org>
---
 .clang-format                                      |  10 +-
 .github/workflows/ci.yml                           |  12 +-
 .github/workflows/verify-package.yml               |   2 +-
 CMakeLists.txt                                     |   2 +-
 PROCESSORS.md                                      |   2 +-
 README.md                                          |   4 +-
 Windows.md                                         |   2 +-
 bootstrap.sh                                       |   2 +-
 cmake/BundledLibRdKafka.cmake                      |  72 ---
 cmake/BundledRocksDB.cmake                         |   3 -
 cmake/DockerConfig.cmake                           |   2 +-
 cmake/Fetchlibrdkafka.cmake                        |  50 ++
 cmake/LZ4.cmake                                    |  22 +-
 cmake/MiNiFiOptions.cmake                          |   2 +-
 cmake/Zstd.cmake                                   |   8 +-
 cmake/zstd/dummy/Findzstd.cmake                    |   1 +
 docker/test/integration/features/kafka.feature     | 259 +++++-----
 extensions/{librdkafka => kafka}/CMakeLists.txt    |  16 +-
 extensions/{librdkafka => kafka}/ConsumeKafka.cpp  | 193 ++++----
 extensions/kafka/ConsumeKafka.h                    | 313 ++++++++++++
 .../{librdkafka => kafka}/KafkaConnection.cpp      |  35 +-
 extensions/{librdkafka => kafka}/KafkaConnection.h |  18 +-
 .../{librdkafka => kafka}/KafkaProcessorBase.cpp   |  28 +-
 extensions/kafka/KafkaProcessorBase.h              | 110 +++++
 extensions/{librdkafka => kafka}/KafkaTopic.h      |  42 +-
 extensions/{librdkafka => kafka}/PublishKafka.cpp  | 550 +++++++++++----------
 extensions/kafka/PublishKafka.h                    | 288 +++++++++++
 extensions/{librdkafka => kafka}/rdkafka_utils.cpp |  46 +-
 extensions/{librdkafka => kafka}/rdkafka_utils.h   |  76 ++-
 .../{librdkafka => kafka}/tests/CMakeLists.txt     |   6 +-
 .../tests/PublishKafkaTests.cpp                    |  34 ++
 extensions/librdkafka/ConsumeKafka.h               | 273 ----------
 extensions/librdkafka/KafkaProcessorBase.h         | 107 ----
 extensions/librdkafka/PublishKafka.h               | 253 ----------
 .../0001-remove-findLZ4-and-findZSTD.patch         |  92 ++++
 thirdparty/librdkafka/high-cpu.patch               | 185 -------
 win_build_vs.bat                                   |   2 +-
 37 files changed, 1567 insertions(+), 1555 deletions(-)

diff --git a/.clang-format b/.clang-format
index 2ca04dd4e..9da446609 100644
--- a/.clang-format
+++ b/.clang-format
@@ -4,6 +4,7 @@ AlignAfterOpenBracket: DontAlign
 AlignConsecutiveAssignments: None
 AlignOperands: DontAlign
 AllowAllParametersOfDeclarationOnNextLine: true
+AllowAllConstructorInitializersOnNextLine: false
 AllowShortBlocksOnASingleLine: Always
 AllowShortCaseLabelsOnASingleLine: true
 AllowShortFunctionsOnASingleLine: Inline
@@ -12,12 +13,13 @@ AllowShortLambdasOnASingleLine: All
 AllowShortLoopsOnASingleLine: true
 AlwaysBreakAfterReturnType: None
 AlwaysBreakTemplateDeclarations: Yes
+AllowAllArgumentsOnNextLine: false
 BreakBeforeBraces: Attach
 BreakBeforeBinaryOperators: None
 BreakBeforeTernaryOperators: true
 BreakConstructorInitializers: BeforeColon
 BreakInheritanceList: BeforeColon
-ColumnLimit: 200
+ColumnLimit: 150
 CompactNamespaces: false
 ContinuationIndentWidth: 4
 IndentCaseLabels: true
@@ -32,7 +34,7 @@ ObjCSpaceBeforeProtocolList: false
 PenaltyIndentedWhitespace: 1
 PointerAlignment: Left
 ReferenceAlignment: Left
-ReflowComments: false
+ReflowComments: true
 SpaceAfterCStyleCast: false
 SpaceAfterLogicalNot: false
 SpaceAfterTemplateKeyword: false
@@ -52,3 +54,7 @@ SpacesInSquareBrackets: false
 Standard: c++20
 TabWidth: 2
 UseTab: Never
+BinPackArguments: false  # Prevents arguments from being packed onto the same line
+PenaltyBreakAssignment: 200
+PenaltyBreakOpenParenthesis: 200
+PenaltyReturnTypeOnItsOwnLine: 200
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 9ec816029..b9e88a418 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,7 +1,7 @@
 name: "MiNiFi-CPP CI"
 on: [push, pull_request, workflow_dispatch]
 env:
-  DOCKER_CMAKE_FLAGS: -DDOCKER_VERIFY_THREAD=3 -DUSE_SHARED_LIBS= -DSTRICT_GSL_CHECKS=AUDIT -DCI_BUILD=ON -DENABLE_AWS=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_MQTT=ON -DENABLE_AZURE=ON -DENABLE_SQL=ON \
+  DOCKER_CMAKE_FLAGS: -DDOCKER_VERIFY_THREAD=3 -DUSE_SHARED_LIBS= -DSTRICT_GSL_CHECKS=AUDIT -DCI_BUILD=ON -DENABLE_AWS=ON -DENABLE_KAFKA=ON -DENABLE_MQTT=ON -DENABLE_AZURE=ON -DENABLE_SQL=ON \
     -DENABLE_SPLUNK=ON -DENABLE_GCP=ON -DENABLE_OPC=ON -DENABLE_PYTHON_SCRIPTING=ON -DENABLE_LUA_SCRIPTING=ON -DENABLE_KUBERNETES=ON -DENABLE_TEST_PROCESSORS=ON -DENABLE_PROMETHEUS=ON \
     -DENABLE_ELASTICSEARCH=ON -DENABLE_GRAFANA_LOKI=ON -DENABLE_COUCHBASE=ON -DDOCKER_BUILD_ONLY=ON
   SCCACHE_GHA_ENABLE: true
@@ -33,7 +33,7 @@ jobs:
         -DENABLE_GCP=ON
         -DENABLE_KUBERNETES=ON
         -DENABLE_LIBARCHIVE=ON
-        -DENABLE_LIBRDKAFKA=ON
+        -DENABLE_KAFKA=ON
         -DENABLE_LUA_SCRIPTING=ON
         -DENABLE_LZMA=ON
         -DENABLE_MQTT=ON
@@ -141,7 +141,7 @@ jobs:
         -DENABLE_GRAFANA_LOKI=ON
         -DENABLE_KUBERNETES=ON
         -DENABLE_LIBARCHIVE=ON
-        -DENABLE_LIBRDKAFKA=ON
+        -DENABLE_KAFKA=ON
         -DENABLE_LUA_SCRIPTING=ON
         -DENABLE_LZMA=ON
         -DENABLE_MQTT=ON
@@ -254,7 +254,7 @@ jobs:
         -DENABLE_GCP=OFF
         -DENABLE_KUBERNETES=OFF
         -DENABLE_LIBARCHIVE=ON
-        -DENABLE_LIBRDKAFKA=OFF
+        -DENABLE_KAFKA=OFF
         -DENABLE_LUA_SCRIPTING=OFF
         -DENABLE_LZMA=ON
         -DENABLE_MQTT=OFF
@@ -354,7 +354,7 @@ jobs:
         -DENABLE_GRAFANA_LOKI=ON
         -DENABLE_KUBERNETES=ON
         -DENABLE_LIBARCHIVE=ON
-        -DENABLE_LIBRDKAFKA=ON
+        -DENABLE_KAFKA=ON
         -DENABLE_LUA_SCRIPTING=ON
         -DENABLE_LZMA=ON
         -DENABLE_MQTT=ON
@@ -507,7 +507,7 @@ jobs:
         run: |
           # rocky build can run out of the github runners' disk space if built with RelWithDebInfo so we keep the Release build here
           mkdir build && cd build && cmake -DUSE_SHARED_LIBS=ON -DCI_BUILD=ON -DCMAKE_BUILD_TYPE=Release -DSTRICT_GSL_CHECKS=AUDIT -DMINIFI_FAIL_ON_WARNINGS=OFF -DENABLE_AWS=ON -DENABLE_AZURE=ON \
-              -DENABLE_ENCRYPT_CONFIG=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_MQTT=ON -DENABLE_OPC=ON -DENABLE_OPENCV=ON -DENABLE_OPS=ON -DENABLE_SQL=ON -DENABLE_SYSTEMD=ON \
+              -DENABLE_ENCRYPT_CONFIG=ON -DENABLE_KAFKA=ON -DENABLE_MQTT=ON -DENABLE_OPC=ON -DENABLE_OPENCV=ON -DENABLE_OPS=ON -DENABLE_SQL=ON -DENABLE_SYSTEMD=ON \
               -DENABLE_PYTHON_SCRIPTING=ON -DENABLE_LUA_SCRIPTING=ON -DENABLE_KUBERNETES=ON -DENABLE_GCP=ON -DENABLE_PROCFS=ON -DENABLE_PROMETHEUS=ON \
               -DENABLE_ELASTICSEARCH=ON -DENABLE_GRAFANA_LOKI=ON -DDOCKER_SKIP_TESTS=OFF -DDOCKER_BUILD_ONLY=ON -DDOCKER_CCACHE_DUMP_LOCATION=${{ env.CCACHE_DIR }} .. && make rocky-test
       - name: cache save
diff --git a/.github/workflows/verify-package.yml b/.github/workflows/verify-package.yml
index 73a69eecb..7e6c0c45c 100644
--- a/.github/workflows/verify-package.yml
+++ b/.github/workflows/verify-package.yml
@@ -1,7 +1,7 @@
 name: "MiNiFi-CPP Verify Package"
 on: [workflow_dispatch]
 env:
-  DOCKER_CMAKE_FLAGS: -DDOCKER_VERIFY_THREAD=3 -DUSE_SHARED_LIBS= -DSTRICT_GSL_CHECKS=AUDIT -DCI_BUILD=ON -DENABLE_AWS=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_MQTT=ON -DENABLE_AZURE=ON -DENABLE_SQL=ON \
+  DOCKER_CMAKE_FLAGS: -DDOCKER_VERIFY_THREAD=3 -DUSE_SHARED_LIBS= -DSTRICT_GSL_CHECKS=AUDIT -DCI_BUILD=ON -DENABLE_AWS=ON -DENABLE_KAFKA=ON -DENABLE_MQTT=ON -DENABLE_AZURE=ON -DENABLE_SQL=ON \
     -DENABLE_SPLUNK=ON -DENABLE_GCP=ON -DENABLE_OPC=ON -DENABLE_PYTHON_SCRIPTING=ON -DENABLE_LUA_SCRIPTING=ON -DENABLE_KUBERNETES=ON -DENABLE_TEST_PROCESSORS=ON -DENABLE_PROMETHEUS=ON \
     -DENABLE_ELASTICSEARCH=OFF -DENABLE_GRAFANA_LOKI=ON -DENABLE_COUCHBASE=ON -DDOCKER_BUILD_ONLY=ON
   CCACHE_DIR: ${{ GITHUB.WORKSPACE }}/.ccache
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 41247d988..50e31d871 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -750,7 +750,7 @@ if (MINIFI_ADVANCED_CODE_COVERAGE)
         NAME coverage
         EXCLUDE "build/*" "cmake/*" "minifi_main/*" "thirdparty/*" "libminifi/test/*" "encrypt-config/tests/*" "extensions/aws/tests/*"
             "extensions/civetweb/tests/*" "extensions/elasticsearch/tests/*" "extensions/expression-language/tests/*" "extensions/gcp/tests/*" "extensions/grafana-loki/tests/*"
-            "extensions/kubernetes/tests/*" "extensions/librdkafka/tests/*" "extensions/lua/tests/*" "extensions/mqtt/tests/*" "extensions/opencv/tests/*" "extensions/procfs/tests/*" "extensions/prometheus/tests/*"
+            "extensions/kubernetes/tests/*" "extensions/kafka/tests/*" "extensions/lua/tests/*" "extensions/mqtt/tests/*" "extensions/opencv/tests/*" "extensions/procfs/tests/*" "extensions/prometheus/tests/*"
             "extensions/script/tests/*" "extensions/sftp/tests/*" "extensions/splunk/tests/*" "extensions/standard-processors/tests/*" "extensions/systemd/tests/*" "extensions/test-processors/*"
             "controller/MiNiFiController.cpp"
     )
diff --git a/PROCESSORS.md b/PROCESSORS.md
index 667130ab4..1cd186de3 100644
--- a/PROCESSORS.md
+++ b/PROCESSORS.md
@@ -2059,7 +2059,7 @@ In the list below, the names of required properties appear in bold. Any other pr
 | Queue Buffering Max Time      | 5 millis      |                                                   | Delay to wait for messages in the producer queue to accumulate before constructing message batches                                                                                                                                                                      |
 | Queue Max Buffer Size         | 1 MB          |                                                   | Maximum total message size sum allowed on the producer queue                                                                                                                                                                                                            |
 | Queue Max Message             | 1000          |                                                   | Maximum number of messages allowed on the producer queue                                                                                                                                                                                                                |
-| Compress Codec                | none          | none<br/>gzip<br/>snappy                          | compression codec to use for compressing message sets                                                                                                                                                                                                                   |
+| Compress Codec                | none          | none<br/>gzip<br/>snappy<br/>lz4<br/>zstd         | compression codec to use for compressing message sets                                                                                                                                                                                                                   |
 | Max Flow Segment Size         | 0 B           |                                                   | Maximum flow content payload segment size for the kafka record. 0 B means unlimited.                                                                                                                                                                                    |
 | Security CA                   |               |                                                   | DEPRECATED in favor of SSL Context Service. File or directory path to CA certificate(s) for verifying the broker's key                                                                                                                                                  |
 | Security Cert                 |               |                                                   | DEPRECATED in favor of SSL Context Service.Path to client's public key (PEM) used for authentication                                                                                                                                                                    |
diff --git a/README.md b/README.md
index 3c659f335..b40d40026 100644
--- a/README.md
+++ b/README.md
@@ -80,7 +80,7 @@ The next table outlines CMAKE flags that correspond with MiNiFi extensions. Exte
 | ExecuteProcess (Linux and macOS) | [ExecuteProcess](PROCESSORS.md#executeprocess)                                                                                                                                                                                                                                                                                                                                                                                                                          [...]
 | Google Cloud Platform            | [DeleteGCSObject](PROCESSORS.md#deletegcsobject)<br>[FetchGCSObject](PROCESSORS.md#fetchgcsobject)<br>[GCPCredentialsControllerService](CONTROLLERS.md#gcpcredentialscontrollerservice)<br>[ListGCSBucket](PROCESSORS.md#listgcsbucket)<br>[PutGCSObject](PROCESSORS.md#putgcsobject)                                                                                                                                                                                   [...]
 | Grafana Loki                     | [PushGrafanaLokiREST](PROCESSORS.md#pushgrafanalokirest)<br>[PushGrafanaLokiGrpc](PROCESSORS.md#pushgrafanalokigrpc)                                                                                                                                                                                                                                                                                                                                                    [...]
-| Kafka                            | [PublishKafka](PROCESSORS.md#publishkafka)<br>[ConsumeKafka](PROCESSORS.md#consumekafka)                                                                                                                                                                                                                                                                                                                                                                                [...]
+| Kafka                            | [PublishKafka](PROCESSORS.md#publishkafka)<br>[ConsumeKafka](PROCESSORS.md#consumekafka)                                                                                                                                                                                                                                                                                                                                                                                [...]
 | Kubernetes (Linux)               | [KubernetesControllerService](CONTROLLERS.md#kubernetescontrollerservice)                                                                                                                                                                                                                                                                                                                                                                                               [...]
 | Lua Scripting                    | [ExecuteScript](PROCESSORS.md#executescript)                                                                                                                                                                                                                                                                                                                                                                                                                            [...]
 | MQTT                             | [ConsumeMQTT](PROCESSORS.md#consumemqtt)<br/>[PublishMQTT](PROCESSORS.md#publishmqtt)                                                                                                                                                                                                                                                                                                                                                                                   [...]
@@ -443,7 +443,7 @@ project infrastructure to build out data pipelines on the edge. For instance, on
 You can create a custom docker image using the cmake configuration to specify which extensions should be included in the final image. Use `-DDOCKER_BUILD_ONLY=ON` to skip local environment checks of cmake.
 ```
 ~/Development/code/apache/nifi-minifi-cpp/build
-$ cmake -DENABLE_AWS=ON -DENABLE_LIBRDKAFKA=ON -DENABLE_MQTT=ON -DENABLE_AZURE=ON -DENABLE_SQL=ON -DDOCKER_BUILD_ONLY=ON ..
+$ cmake -DENABLE_AWS=ON -DENABLE_KAFKA=ON -DENABLE_MQTT=ON -DENABLE_AZURE=ON -DENABLE_SQL=ON -DDOCKER_BUILD_ONLY=ON ..
 $ make docker
 ```
 
diff --git a/Windows.md b/Windows.md
index 3afb5d287..7cca69220 100644
--- a/Windows.md
+++ b/Windows.md
@@ -122,7 +122,7 @@ A basic working CMake configuration can be inferred from the `win_build_vs.bat`.
 ```
 mkdir build
 cd build
-cmake -G "Visual Studio 17 2022" -A x64 -DMINIFI_INCLUDE_VC_REDIST_MERGE_MODULES=OFF -DTEST_CUSTOM_WEL_PROVIDER=OFF -DENABLE_SQL=OFF -DMINIFI_USE_REAL_ODBC_TEST_DRIVER=OFF -DCMAKE_BUILD_TYPE_INIT=Release -DCMAKE_BUILD_TYPE=Release -DWIN32=WIN32 -DENABLE_LIBRDKAFKA=OFF -DENABLE_AWS=OFF -DENABLE_PDH= -DENABLE_AZURE=OFF -DENABLE_SFTP=OFF -DENABLE_SPLUNK= -DENABLE_GCP= -DENABLE_OPENCV=OFF -DENABLE_PROMETHEUS=OFF -DENABLE_ELASTICSEARCH= -DUSE_SHARED_LIBS=OFF -DENABLE_CONTROLLER=ON -DENABLE_BU [...]
+cmake -G "Visual Studio 17 2022" -A x64 -DMINIFI_INCLUDE_VC_REDIST_MERGE_MODULES=OFF -DTEST_CUSTOM_WEL_PROVIDER=OFF -DENABLE_SQL=OFF -DMINIFI_USE_REAL_ODBC_TEST_DRIVER=OFF -DCMAKE_BUILD_TYPE_INIT=Release -DCMAKE_BUILD_TYPE=Release -DWIN32=WIN32 -DENABLE_KAFKA=OFF -DENABLE_AWS=OFF -DENABLE_PDH= -DENABLE_AZURE=OFF -DENABLE_SFTP=OFF -DENABLE_SPLUNK= -DENABLE_GCP= -DENABLE_OPENCV=OFF -DENABLE_PROMETHEUS=OFF -DENABLE_ELASTICSEARCH= -DUSE_SHARED_LIBS=OFF -DENABLE_CONTROLLER=ON -DENABLE_BUSTACH [...]
 msbuild /m nifi-minifi-cpp.sln /property:Configuration=Release /property:Platform=x64
 copy minifi_main\Release\minifi.exe minifi_main\
 cpack
diff --git a/bootstrap.sh b/bootstrap.sh
index 6b331de18..c723327fd 100755
--- a/bootstrap.sh
+++ b/bootstrap.sh
@@ -279,7 +279,7 @@ add_dependency EXPRESSION_LANGUAGE_ENABLED "flex"
 
 add_option AWS_ENABLED ${TRUE} "ENABLE_AWS"
 
-add_option KAFKA_ENABLED ${TRUE} "ENABLE_LIBRDKAFKA"
+add_option KAFKA_ENABLED ${TRUE} "ENABLE_KAFKA"
 
 add_option KUBERNETES_ENABLED ${TRUE} "ENABLE_KUBERNETES"
 
diff --git a/cmake/BundledLibRdKafka.cmake b/cmake/BundledLibRdKafka.cmake
deleted file mode 100644
index b3c410840..000000000
--- a/cmake/BundledLibRdKafka.cmake
+++ /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.
-
-function(use_bundled_librdkafka SOURCE_DIR BINARY_DIR)
-    set(PC "${Patch_EXECUTABLE}" -p1 -i "${SOURCE_DIR}/thirdparty/librdkafka/high-cpu.patch")
-
-    # Define byproducts
-    if(WIN32)
-        set(BYPRODUCT "lib/rdkafka.lib")
-    else()
-        set(BYPRODUCT "lib/librdkafka.a")
-    endif()
-
-    # Set build options
-    set(LIBRDKAFKA_CMAKE_ARGS ${PASSTHROUGH_CMAKE_ARGS}
-            "-DCMAKE_INSTALL_PREFIX=${BINARY_DIR}/thirdparty/librdkafka-install"
-            "-DWITH_SSL=ON"
-            "-DWITH_SASL=OFF"
-            "-DRDKAFKA_BUILD_STATIC=ON"
-            "-DRDKAFKA_BUILD_EXAMPLES=OFF"
-            "-DRDKAFKA_BUILD_TESTS=OFF"
-            "-DENABLE_LZ4_EXT=OFF"
-            "-DWITH_ZSTD=OFF"
-            "-DCMAKE_INSTALL_LIBDIR=lib"
-            "-DLIBRDKAFKA_STATICLIB=1")
-
-    append_third_party_passthrough_args(LIBRDKAFKA_CMAKE_ARGS "${LIBRDKAFKA_CMAKE_ARGS}")
-
-    # Build project
-    ExternalProject_Add(
-            kafka-external
-            URL "https://github.com/confluentinc/librdkafka/archive/v1.6.0.tar.gz"
-            URL_HASH "SHA256=3130cbd391ef683dc9acf9f83fe82ff93b8730a1a34d0518e93c250929be9f6b"
-            LIST_SEPARATOR % # This is needed for passing semicolon-separated lists
-            CMAKE_ARGS ${LIBRDKAFKA_CMAKE_ARGS}
-            PATCH_COMMAND ${PC}
-            BUILD_BYPRODUCTS "${BINARY_DIR}/thirdparty/librdkafka-install/${BYPRODUCT}"
-            EXCLUDE_FROM_ALL TRUE
-    )
-
-    # Set dependencies
-    add_dependencies(kafka-external OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB)
-
-    # Set variables
-    set(LIBRDKAFKA_FOUND "YES" CACHE STRING "" FORCE)
-    set(LIBRDKAFKA_INCLUDE_DIR "${BINARY_DIR}/thirdparty/librdkafka-install/include/librdkafka" CACHE STRING "" FORCE)
-    set(LIBRDKAFKA_LIBRARY "${BINARY_DIR}/thirdparty/librdkafka-install/${BYPRODUCT}" CACHE STRING "" FORCE)
-    set(LIBRDKAFKA_LIBRARIES ${LIBRDKAFKA_LIBRARY} CACHE STRING "" FORCE)
-
-    # Create imported targets
-    add_library(librdkafka STATIC IMPORTED)
-    set_target_properties(librdkafka PROPERTIES IMPORTED_LOCATION "${LIBRDKAFKA_LIBRARY}")
-    add_dependencies(librdkafka kafka-external)
-    set_property(TARGET librdkafka APPEND PROPERTY INTERFACE_LINK_LIBRARIES OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB Threads::Threads)
-    file(MAKE_DIRECTORY ${LIBRDKAFKA_INCLUDE_DIR})
-    set_property(TARGET librdkafka APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${LIBRDKAFKA_INCLUDE_DIR})
-    set_property(TARGET librdkafka APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS "LIBRDKAFKA_STATICLIB=1")
-endfunction(use_bundled_librdkafka)
diff --git a/cmake/BundledRocksDB.cmake b/cmake/BundledRocksDB.cmake
index ac2a6e203..ec137201d 100644
--- a/cmake/BundledRocksDB.cmake
+++ b/cmake/BundledRocksDB.cmake
@@ -20,10 +20,7 @@ function(use_bundled_rocksdb SOURCE_DIR BINARY_DIR)
 
     if (NOT WIN32)
         include(Zstd)
-        list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/zstd/dummy")
-
         include(LZ4)
-        list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/lz4/dummy")
     endif()
 
     # Patch to fix build issue on ARM7 architecture: https://github.com/facebook/rocksdb/issues/8609#issuecomment-1009572506
diff --git a/cmake/DockerConfig.cmake b/cmake/DockerConfig.cmake
index 860503387..956d0c097 100644
--- a/cmake/DockerConfig.cmake
+++ b/cmake/DockerConfig.cmake
@@ -51,7 +51,7 @@ add_custom_target(
              -DENABLE_CIVET=OFF
              -DENABLE_SQL=OFF
              -DENABLE_MQTT=OFF
-             -DENABLE_LIBRDKAFKA=OFF
+             -DENABLE_KAFKA=OFF
              -DENABLE_LUA_SCRIPTING=OFF
              -DENABLE_PYTHON_SCRIPTING=OFF
              -DENABLE_AWS=OFF
diff --git a/cmake/Fetchlibrdkafka.cmake b/cmake/Fetchlibrdkafka.cmake
new file mode 100644
index 000000000..49b600b59
--- /dev/null
+++ b/cmake/Fetchlibrdkafka.cmake
@@ -0,0 +1,50 @@
+# 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.
+
+include(FetchContent)
+include(Zstd)
+
+include(LZ4)
+
+set(WITH_SSL "ON" CACHE STRING "" FORCE)
+set(WITH_SASL "OFF" CACHE STRING "" FORCE)
+set(WITH_ZSTD "ON" CACHE STRING "" FORCE)
+set(WITH_SNAPPY "ON" CACHE STRING "" FORCE)
+set(ENABLE_LZ4_EXT "ON" CACHE STRING "" FORCE)
+set(RDKAFKA_BUILD_STATIC "ON" CACHE STRING "" FORCE)
+set(RDKAFKA_BUILD_EXAMPLES "OFF" CACHE STRING "" FORCE)
+set(RDKAFKA_BUILD_TESTS "OFF" CACHE STRING "" FORCE)
+set(LIBRDKAFKA_STATICLIB "1" CACHE STRING "" FORCE)
+
+set(PATCH_FILE "${CMAKE_SOURCE_DIR}/thirdparty/librdkafka/0001-remove-findLZ4-and-findZSTD.patch")
+set(PC "${Patch_EXECUTABLE}" -p1 -i "${PATCH_FILE}")
+
+FetchContent_Declare(libkafka
+        URL https://github.com/confluentinc/librdkafka/archive/refs/tags/v2.6.0.tar.gz
+        URL_HASH SHA256=abe0212ecd3e7ed3c4818a4f2baf7bf916e845e902bb15ae48834ca2d36ac745
+        PATCH_COMMAND "${PC}"
+)
+
+FetchContent_MakeAvailable(libkafka)
+
+get_target_property(ZSTD_INCLUDE_DIRS zstd::zstd INCLUDE_DIRECTORIES)
+get_target_property(LZ4_INCLUDE_DIRS lz4::lz4 INCLUDE_DIRECTORIES)
+
+target_include_directories(rdkafka SYSTEM PRIVATE ${ZSTD_INCLUDE_DIRS})
+target_include_directories(rdkafka SYSTEM PRIVATE ${LZ4_INCLUDE_DIRS})
+
+target_link_libraries(rdkafka INTERFACE zstd::zstd lz4::lz4)
diff --git a/cmake/LZ4.cmake b/cmake/LZ4.cmake
index 53465dee3..f008d9933 100644
--- a/cmake/LZ4.cmake
+++ b/cmake/LZ4.cmake
@@ -17,6 +17,8 @@
 
 include(FetchContent)
 
+list(PREPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/lz4/dummy")
+
 set(LZ4_BUILD_CLI OFF CACHE BOOL "" FORCE)
 set(LZ4_BUILD_LEGACY_LZ4C OFF CACHE BOOL "" FORCE)
 set(BUILD_SHARED_LIBS OFF CACHE BOOL "" FORCE)
@@ -26,11 +28,29 @@ FetchContent_Declare(lz4
     URL            https://github.com/lz4/lz4/archive/refs/tags/v1.9.4.tar.gz
     URL_HASH       SHA256=0b0e3aa07c8c063ddf40b082bdf7e37a1562bda40a0ff5272957f3e987e0e54b
     SOURCE_SUBDIR  build/cmake
+    OVERRIDE_FIND_PACKAGE
 )
 
 FetchContent_MakeAvailable(lz4)
 
-add_library(lz4::lz4 ALIAS lz4_static)
+if(NOT TARGET lz4::lz4)
+    add_library(lz4::lz4 ALIAS lz4_static)
+    add_library(LZ4::LZ4 ALIAS lz4_static)
+
+    install(TARGETS lz4_static
+            EXPORT Lz4Targets          # Add to Lz4Targets export set
+            ARCHIVE DESTINATION lib
+            LIBRARY DESTINATION lib
+            RUNTIME DESTINATION bin
+    )
+
+    # Install the export set itself
+    install(EXPORT Lz4Targets
+            FILE Lz4Targets.cmake       # Generate Lz4Targets.cmake file
+            NAMESPACE lz4::             # Set the namespace to lz4::
+            DESTINATION lib/cmake/Lz4   # Where to install the CMake config
+    )
+endif()
 
 # Set variables
 set(LZ4_FOUND "YES" CACHE STRING "" FORCE)
diff --git a/cmake/MiNiFiOptions.cmake b/cmake/MiNiFiOptions.cmake
index e69548ba0..60cf179a9 100644
--- a/cmake/MiNiFiOptions.cmake
+++ b/cmake/MiNiFiOptions.cmake
@@ -94,7 +94,7 @@ add_minifi_option(ENABLE_LZMA "Enables the liblzma build" ON)
 add_minifi_option(ENABLE_BZIP2 "Enables the bzip2 build" ON)
 add_minifi_option(ENABLE_SQL "Enables the SQL Suite of Tools." ON)
 add_minifi_option(ENABLE_MQTT "Enables the mqtt extension." ON)
-add_minifi_option(ENABLE_LIBRDKAFKA "Enables the librdkafka extension." ON)
+add_minifi_option(ENABLE_KAFKA "Enables the kafka extension." ON)
 add_minifi_option(ENABLE_LUA_SCRIPTING "Enables lua scripting" ON)
 add_minifi_option(ENABLE_PYTHON_SCRIPTING "Enables python scripting" ON)
 add_minifi_option(ENABLE_AWS "Enables AWS support." ON)
diff --git a/cmake/Zstd.cmake b/cmake/Zstd.cmake
index 52de9d1dd..15f87ad6d 100644
--- a/cmake/Zstd.cmake
+++ b/cmake/Zstd.cmake
@@ -17,6 +17,8 @@
 
 include(FetchContent)
 
+list(PREPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/zstd/dummy")
+
 set(ZSTD_BUILD_SHARED OFF CACHE BOOL "" FORCE)
 
 set(PC "")
@@ -34,15 +36,19 @@ FetchContent_Declare(zstd
 
 FetchContent_MakeAvailable(zstd)
 
-add_library(zstd::zstd ALIAS libzstd_static)
+if (NOT TARGET zstd::zstd)
+    add_library(zstd::zstd ALIAS libzstd_static)
+endif()
 
 # Set variables
 set(ZSTD_FOUND "YES" CACHE STRING "" FORCE)
 set(ZSTD_INCLUDE_DIRS "${zstd_SOURCE_DIR}/lib" CACHE STRING "" FORCE)
 if (WIN32)
     set(ZSTD_LIBRARIES "${zstd_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE}/zstd_static.lib" CACHE STRING "" FORCE)
+    set(ZSTD_LIBRARY "${zstd_BINARY_DIR}/lib/${CMAKE_BUILD_TYPE}/zstd_static.lib" CACHE STRING "" FORCE)
 else()
     set(ZSTD_LIBRARIES "${zstd_BINARY_DIR}/lib/libzstd.a" CACHE STRING "" FORCE)
+    set(ZSTD_LIBRARY "${zstd_BINARY_DIR}/lib/libzstd.a" CACHE STRING "" FORCE)
 endif()
 
 # Set exported variables for FindPackage.cmake
diff --git a/cmake/zstd/dummy/Findzstd.cmake b/cmake/zstd/dummy/Findzstd.cmake
index 4d857e32c..2d06594e0 100644
--- a/cmake/zstd/dummy/Findzstd.cmake
+++ b/cmake/zstd/dummy/Findzstd.cmake
@@ -21,6 +21,7 @@ if(NOT zstd_FOUND)
     set(ZSTD_INCLUDE_DIR "${EXPORTED_ZSTD_INCLUDE_DIRS}" CACHE STRING "" FORCE)
     set(ZSTD_INCLUDE_DIRS "${EXPORTED_ZSTD_INCLUDE_DIRS}" CACHE STRING "" FORCE)
     set(ZSTD_LIBRARIES "${EXPORTED_ZSTD_LIBRARIES}" CACHE STRING "" FORCE)
+    set(ZSTD_LIBRARY "${EXPORTED_ZSTD_LIBRARIES}" CACHE STRING "" FORCE)
 endif()
 
 if(NOT TARGET zstd::zstd)
diff --git a/docker/test/integration/features/kafka.feature b/docker/test/integration/features/kafka.feature
index 02aca2cc0..e7dedc2b2 100644
--- a/docker/test/integration/features/kafka.feature
+++ b/docker/test/integration/features/kafka.feature
@@ -13,7 +13,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-@ENABLE_LIBRDKAFKA
+@ENABLE_KAFKA
 Feature: Sending data to using Kafka streaming platform using PublishKafka
   In order to send data to a Kafka stream
   As a user of MiNiFi
@@ -22,26 +22,27 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
   Background:
     Given the content of "/tmp/output" is monitored
 
-  Scenario: A MiNiFi instance transfers data to a kafka broker
+  Scenario Outline: A MiNiFi instance transfers data to a kafka broker
     Given a GetFile processor with the "Input Directory" property set to "/tmp/input"
     And a file with the content "test" is present in "/tmp/input"
     And a UpdateAttribute processor
     And these processor properties are set:
-      | processor name  | property name          | property value                        |
-      | UpdateAttribute | kafka_require_num_acks | 1                                     |
-      | UpdateAttribute | kafka_message_key      | unique_message_key_123                |
+      | processor name  | property name          | property value         |
+      | UpdateAttribute | kafka_require_num_acks | 1                      |
+      | UpdateAttribute | kafka_message_key      | unique_message_key_123 |
     And a PublishKafka processor set up to communicate with a kafka broker instance
     And these processor properties are set:
-      | processor name | property name          | property value                                        |
-      | PublishKafka   | Topic Name             | test                                                  |
-      | PublishKafka   | Delivery Guarantee     | ${kafka_require_num_acks}                             |
-      | PublishKafka   | Request Timeout        | 12 s                                                  |
-      | PublishKafka   | Message Timeout        | 13 s                                                  |
-      | PublishKafka   | Known Brokers          | kafka-broker-${feature_id}:${literal(9000):plus(92)}  |
-      | PublishKafka   | Client Name            | client_no_${literal(6):multiply(7)}                   |
-      | PublishKafka   | Kafka Key              | ${kafka_message_key}                                  |
-      | PublishKafka   | retry.backoff.ms       | ${literal(2):multiply(25):multiply(3)}                |
-      | PublishKafka   | Message Key Field      | kafka.key                                             |
+      | processor name | property name      | property value                                       |
+      | PublishKafka   | Topic Name         | test                                                 |
+      | PublishKafka   | Delivery Guarantee | ${kafka_require_num_acks}                            |
+      | PublishKafka   | Request Timeout    | 12 s                                                 |
+      | PublishKafka   | Message Timeout    | 13 s                                                 |
+      | PublishKafka   | Known Brokers      | kafka-broker-${feature_id}:${literal(9000):plus(92)} |
+      | PublishKafka   | Client Name        | client_no_${literal(6):multiply(7)}                  |
+      | PublishKafka   | Kafka Key          | ${kafka_message_key}                                 |
+      | PublishKafka   | retry.backoff.ms   | ${literal(2):multiply(25):multiply(3)}               |
+      | PublishKafka   | Message Key Field  | kafka.key                                            |
+      | PublishKafka   | Compress Codec     | <compress_codec>                                     |
     And a PutFile processor with the "Directory" property set to "/tmp/output"
     And the "success" relationship of the GetFile processor is connected to the UpdateAttribute
     And the "success" relationship of the UpdateAttribute processor is connected to the PublishKafka
@@ -62,6 +63,14 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
     And the Minifi logs contain the following message: "PublishKafka: DynamicProperty: [retry.backoff.ms] -> [150]" in less than 10 seconds
     And the Minifi logs contain the following message: "The Message Key Field property is set. This property is DEPRECATED and has no effect; please use Kafka Key instead." in less than 10 seconds
 
+    Examples: Compression formats
+      | compress_codec |
+      | none           |
+      | snappy         |
+      | gzip           |
+      | lz4            |
+      | zstd           |
+
   Scenario: PublishKafka sends flowfiles to failure when the broker is not available
     Given a GetFile processor with the "Input Directory" property set to "/tmp/input"
     And a file with the content "no broker" is present in "/tmp/input"
@@ -78,19 +87,19 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
     And a file with the content "test" is present in "/tmp/input"
     And a PublishKafka processor set up to communicate with a kafka broker instance
     And these processor properties are set:
-      | processor name | property name          | property value                                   |
-      | PublishKafka   | Client Name            | LMN                                              |
-      | PublishKafka   | Known Brokers          | kafka-broker-${feature_id}:9093                  |
-      | PublishKafka   | Topic Name             | test                                             |
-      | PublishKafka   | Batch Size             | 10                                               |
-      | PublishKafka   | Compress Codec         | none                                             |
-      | PublishKafka   | Delivery Guarantee     | 1                                                |
-      | PublishKafka   | Request Timeout        | 10 sec                                           |
-      | PublishKafka   | Message Timeout        | 12 sec                                           |
-      | PublishKafka   | Security CA            | /tmp/resources/root_ca.crt                       |
-      | PublishKafka   | Security Cert          | /tmp/resources/minifi_client.crt                 |
-      | PublishKafka   | Security Private Key   | /tmp/resources/minifi_client.key                 |
-      | PublishKafka   | Security Protocol      | ssl                                              |
+      | processor name | property name        | property value                   |
+      | PublishKafka   | Client Name          | LMN                              |
+      | PublishKafka   | Known Brokers        | kafka-broker-${feature_id}:9093  |
+      | PublishKafka   | Topic Name           | test                             |
+      | PublishKafka   | Batch Size           | 10                               |
+      | PublishKafka   | Compress Codec       | none                             |
+      | PublishKafka   | Delivery Guarantee   | 1                                |
+      | PublishKafka   | Request Timeout      | 10 sec                           |
+      | PublishKafka   | Message Timeout      | 12 sec                           |
+      | PublishKafka   | Security CA          | /tmp/resources/root_ca.crt       |
+      | PublishKafka   | Security Cert        | /tmp/resources/minifi_client.crt |
+      | PublishKafka   | Security Private Key | /tmp/resources/minifi_client.key |
+      | PublishKafka   | Security Protocol    | ssl                              |
     And a PutFile processor with the "Directory" property set to "/tmp/output"
     And the "success" relationship of the GetFile processor is connected to the PublishKafka
     And the "success" relationship of the PublishKafka processor is connected to the PutFile
@@ -109,16 +118,16 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
     And a file with the content "test" is present in "/tmp/input"
     And a PublishKafka processor set up to communicate with a kafka broker instance
     And these processor properties are set:
-      | processor name | property name          | property value                         |
-      | PublishKafka   | Topic Name             | test                                   |
-      | PublishKafka   | Request Timeout        | 10 sec                                 |
-      | PublishKafka   | Message Timeout        | 12 sec                                 |
-      | PublishKafka   | Known Brokers          | kafka-broker-${feature_id}:9094        |
-      | PublishKafka   | Client Name            | LMN                                    |
-      | PublishKafka   | Security Protocol      | sasl_plaintext                         |
-      | PublishKafka   | SASL Mechanism         | PLAIN                                  |
-      | PublishKafka   | Username               | alice                                  |
-      | PublishKafka   | Password               | alice-secret                           |
+      | processor name | property name     | property value                  |
+      | PublishKafka   | Topic Name        | test                            |
+      | PublishKafka   | Request Timeout   | 10 sec                          |
+      | PublishKafka   | Message Timeout   | 12 sec                          |
+      | PublishKafka   | Known Brokers     | kafka-broker-${feature_id}:9094 |
+      | PublishKafka   | Client Name       | LMN                             |
+      | PublishKafka   | Security Protocol | sasl_plaintext                  |
+      | PublishKafka   | SASL Mechanism    | PLAIN                           |
+      | PublishKafka   | Username          | alice                           |
+      | PublishKafka   | Password          | alice-secret                    |
     And a PutFile processor with the "Directory" property set to "/tmp/output"
     And the "success" relationship of the GetFile processor is connected to the PublishKafka
     And the "success" relationship of the PublishKafka processor is connected to the PutFile
@@ -134,22 +143,22 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
     And a file with the content "test" is present in "/tmp/input"
     And a PublishKafka processor set up to communicate with a kafka broker instance
     And these processor properties are set:
-      | processor name | property name          | property value                                  |
-      | PublishKafka   | Client Name            | LMN                                             |
-      | PublishKafka   | Known Brokers          | kafka-broker-${feature_id}:9095                 |
-      | PublishKafka   | Topic Name             | test                                            |
-      | PublishKafka   | Batch Size             | 10                                              |
-      | PublishKafka   | Compress Codec         | none                                            |
-      | PublishKafka   | Delivery Guarantee     | 1                                               |
-      | PublishKafka   | Request Timeout        | 10 sec                                          |
-      | PublishKafka   | Message Timeout        | 12 sec                                          |
-      | PublishKafka   | Security CA            | /tmp/resources/root_ca.crt                      |
-      | PublishKafka   | Security Cert          | /tmp/resources/minifi_client.crt                |
-      | PublishKafka   | Security Private Key   | /tmp/resources/minifi_client.key                |
-      | PublishKafka   | Security Protocol      | sasl_ssl                                        |
-      | PublishKafka   | SASL Mechanism         | PLAIN                                           |
-      | PublishKafka   | Username               | alice                                           |
-      | PublishKafka   | Password               | alice-secret                                    |
+      | processor name | property name        | property value                   |
+      | PublishKafka   | Client Name          | LMN                              |
+      | PublishKafka   | Known Brokers        | kafka-broker-${feature_id}:9095  |
+      | PublishKafka   | Topic Name           | test                             |
+      | PublishKafka   | Batch Size           | 10                               |
+      | PublishKafka   | Compress Codec       | none                             |
+      | PublishKafka   | Delivery Guarantee   | 1                                |
+      | PublishKafka   | Request Timeout      | 10 sec                           |
+      | PublishKafka   | Message Timeout      | 12 sec                           |
+      | PublishKafka   | Security CA          | /tmp/resources/root_ca.crt       |
+      | PublishKafka   | Security Cert        | /tmp/resources/minifi_client.crt |
+      | PublishKafka   | Security Private Key | /tmp/resources/minifi_client.key |
+      | PublishKafka   | Security Protocol    | sasl_ssl                         |
+      | PublishKafka   | SASL Mechanism       | PLAIN                            |
+      | PublishKafka   | Username             | alice                            |
+      | PublishKafka   | Password             | alice-secret                     |
     And a PutFile processor with the "Directory" property set to "/tmp/output"
     And the "success" relationship of the GetFile processor is connected to the PublishKafka
     And the "success" relationship of the PublishKafka processor is connected to the PutFile
@@ -165,19 +174,19 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
     And a file with the content "test" is present in "/tmp/input"
     And a PublishKafka processor set up to communicate with a kafka broker instance
     And these processor properties are set:
-      | processor name | property name          | property value                             |
-      | PublishKafka   | Client Name            | LMN                                        |
-      | PublishKafka   | Known Brokers          | kafka-broker-${feature_id}:9095            |
-      | PublishKafka   | Topic Name             | test                                       |
-      | PublishKafka   | Batch Size             | 10                                         |
-      | PublishKafka   | Compress Codec         | none                                       |
-      | PublishKafka   | Delivery Guarantee     | 1                                          |
-      | PublishKafka   | Request Timeout        | 10 sec                                     |
-      | PublishKafka   | Message Timeout        | 12 sec                                     |
-      | PublishKafka   | Security Protocol      | sasl_ssl                                   |
-      | PublishKafka   | SASL Mechanism         | PLAIN                                      |
-      | PublishKafka   | Username               | alice                                      |
-      | PublishKafka   | Password               | alice-secret                               |
+      | processor name | property name      | property value                  |
+      | PublishKafka   | Client Name        | LMN                             |
+      | PublishKafka   | Known Brokers      | kafka-broker-${feature_id}:9095 |
+      | PublishKafka   | Topic Name         | test                            |
+      | PublishKafka   | Batch Size         | 10                              |
+      | PublishKafka   | Compress Codec     | none                            |
+      | PublishKafka   | Delivery Guarantee | 1                               |
+      | PublishKafka   | Request Timeout    | 10 sec                          |
+      | PublishKafka   | Message Timeout    | 12 sec                          |
+      | PublishKafka   | Security Protocol  | sasl_ssl                        |
+      | PublishKafka   | SASL Mechanism     | PLAIN                           |
+      | PublishKafka   | Username           | alice                           |
+      | PublishKafka   | Password           | alice-secret                    |
     And a PutFile processor with the "Directory" property set to "/tmp/output"
     And an ssl context service is set up for PublishKafka
     And the "success" relationship of the GetFile processor is connected to the PublishKafka
@@ -194,16 +203,16 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
     And a file with the content "test" is present in "/tmp/input"
     And a PublishKafka processor set up to communicate with a kafka broker instance
     And these processor properties are set:
-      | processor name | property name          | property value                             |
-      | PublishKafka   | Client Name            | LMN                                        |
-      | PublishKafka   | Known Brokers          | kafka-broker-${feature_id}:9093            |
-      | PublishKafka   | Topic Name             | test                                       |
-      | PublishKafka   | Batch Size             | 10                                         |
-      | PublishKafka   | Compress Codec         | none                                       |
-      | PublishKafka   | Delivery Guarantee     | 1                                          |
-      | PublishKafka   | Request Timeout        | 10 sec                                     |
-      | PublishKafka   | Message Timeout        | 12 sec                                     |
-      | PublishKafka   | Security Protocol      | ssl                                        |
+      | processor name | property name      | property value                  |
+      | PublishKafka   | Client Name        | LMN                             |
+      | PublishKafka   | Known Brokers      | kafka-broker-${feature_id}:9093 |
+      | PublishKafka   | Topic Name         | test                            |
+      | PublishKafka   | Batch Size         | 10                              |
+      | PublishKafka   | Compress Codec     | none                            |
+      | PublishKafka   | Delivery Guarantee | 1                               |
+      | PublishKafka   | Request Timeout    | 10 sec                          |
+      | PublishKafka   | Message Timeout    | 12 sec                          |
+      | PublishKafka   | Security Protocol  | ssl                             |
     And a PutFile processor with the "Directory" property set to "/tmp/output"
     And an ssl context service is set up for PublishKafka
     And the "success" relationship of the GetFile processor is connected to the PublishKafka
@@ -248,13 +257,13 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
 
     Then two flowfiles with the contents "<message 1>" and "<message 2>" are placed in the monitored directory in less than 90 seconds
 
-  Examples: Topic names and formats to test
-    | message 1            | message 2           | topic names              | topic name format |
-    | Ulysses              | James Joyce         | ConsumeKafkaTest         | (not set)         |
-    | The Great Gatsby     | F. Scott Fitzgerald | ConsumeKafkaTest         | Names             |
-    | War and Peace        | Lev Tolstoy         | a,b,c,ConsumeKafkaTest,d | Names             |
-    | Nineteen Eighty Four | George Orwell       | ConsumeKafkaTest         | Patterns          |
-    | Hamlet               | William Shakespeare | Cons[emu]*KafkaTest      | Patterns          |
+    Examples: Topic names and formats to test
+      | message 1            | message 2           | topic names              | topic name format |
+      | Ulysses              | James Joyce         | ConsumeKafkaTest         | (not set)         |
+      | The Great Gatsby     | F. Scott Fitzgerald | ConsumeKafkaTest         | Names             |
+      | War and Peace        | Lev Tolstoy         | a,b,c,ConsumeKafkaTest,d | Names             |
+      | Nineteen Eighty Four | George Orwell       | ConsumeKafkaTest         | Patterns          |
+      | Hamlet               | William Shakespeare | Cons[emu]*KafkaTest      | Patterns          |
 
   Scenario: ConsumeKafka consumes only messages after MiNiFi startup when "Offset Reset" property is set to latest
     Given a ConsumeKafka processor set up in a "kafka-consumer-flow" flow
@@ -294,12 +303,12 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
 
     Then two flowfiles with the contents "<message 1>" and "<message 2>" are placed in the monitored directory in less than 45 seconds
 
-  Examples: Key attribute encoding values
-    | message 1            | message 2                     | key attribute encoding |
-    | The Odyssey          | Ὅμηρος                       | (not set)              |
-    | Lolita               | Владимир Владимирович Набоков | utf-8                  |
-    | Crime and Punishment | Фёдор Михайлович Достоевский  | hex                    |
-    | Paradise Lost        | John Milton                   | hEX                    |
+    Examples: Key attribute encoding values
+      | message 1            | message 2                     | key attribute encoding |
+      | The Odyssey          | Ὅμηρος                        | (not set)              |
+      | Lolita               | Владимир Владимирович Набоков | utf-8                  |
+      | Crime and Punishment | Фёдор Михайлович Достоевский  | hex                    |
+      | Paradise Lost        | John Milton                   | hEX                    |
 
   Scenario Outline: ConsumeKafka transactional behaviour is supported
     Given a ConsumeKafka processor set up in a "kafka-consumer-flow" flow
@@ -315,14 +324,14 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
 
     Then <number of flowfiles expected> flowfiles are placed in the monitored directory in less than 15 seconds
 
-  Examples: Transaction descriptions
-    | messages sent                     | transaction type             | honor transactions | number of flowfiles expected |
-    | Pride and Prejudice, Jane Austen  | SINGLE_COMMITTED_TRANSACTION | (not set)          | 2                            |
-    | Dune, Frank Herbert               | TWO_SEPARATE_TRANSACTIONS    | (not set)          | 2                            |
-    | The Black Sheep, Honore De Balzac | NON_COMMITTED_TRANSACTION    | (not set)          | 0                            |
-    | Gospel of Thomas                  | CANCELLED_TRANSACTION        | (not set)          | 0                            |
-    | Operation Dark Heart              | CANCELLED_TRANSACTION        | true               | 0                            |
-    | Brexit                            | CANCELLED_TRANSACTION        | false              | 1                            |
+    Examples: Transaction descriptions
+      | messages sent                     | transaction type             | honor transactions | number of flowfiles expected |
+      | Pride and Prejudice, Jane Austen  | SINGLE_COMMITTED_TRANSACTION | (not set)          | 2                            |
+      | Dune, Frank Herbert               | TWO_SEPARATE_TRANSACTIONS    | (not set)          | 2                            |
+      | The Black Sheep, Honore De Balzac | NON_COMMITTED_TRANSACTION    | (not set)          | 0                            |
+      | Gospel of Thomas                  | CANCELLED_TRANSACTION        | (not set)          | 0                            |
+      | Operation Dark Heart              | CANCELLED_TRANSACTION        | true               | 0                            |
+      | Brexit                            | CANCELLED_TRANSACTION        | false              | 1                            |
 
   Scenario Outline: Headers on consumed kafka messages are extracted into attributes if requested on ConsumeKafka
     Given a ConsumeKafka processor set up in a "kafka-consumer-flow" flow
@@ -345,14 +354,14 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
 
     Then two flowfiles with the contents "<message 1>" and "<message 2>" are placed in the monitored directory in less than 45 seconds
 
-  Examples: Messages with headers
-    | message 1             | message 2         | message headers sent        | headers to add as attributes | expected value       | duplicate header handling |
-    | Homeland              | R. A. Salvatore   | Contains dark elves: yes    | (not set)                    | (not set)            | (not set)                 |
-    | Magician              | Raymond E. Feist  | Rating: 10/10               | Rating                       | 10/10                | (not set)                 |
-    | Mistborn              | Brandon Sanderson | Metal: Copper; Metal: Iron  | Metal                        | Copper               | Keep First                |
-    | Mistborn              | Brandon Sanderson | Metal: Copper; Metal: Iron  | Metal                        | Iron                 | Keep Latest               |
-    | Mistborn              | Brandon Sanderson | Metal: Copper; Metal: Iron  | Metal                        | Copper, Iron         | Comma-separated Merge     |
-    | The Lord of the Rings | J. R. R. Tolkien  | Parts: First, second, third | Parts                        | First, second, third | (not set)                 |
+    Examples: Messages with headers
+      | message 1             | message 2         | message headers sent        | headers to add as attributes | expected value       | duplicate header handling |
+      | Homeland              | R. A. Salvatore   | Contains dark elves: yes    | (not set)                    | (not set)            | (not set)                 |
+      | Magician              | Raymond E. Feist  | Rating: 10/10               | Rating                       | 10/10                | (not set)                 |
+      | Mistborn              | Brandon Sanderson | Metal: Copper; Metal: Iron  | Metal                        | Copper               | Keep First                |
+      | Mistborn              | Brandon Sanderson | Metal: Copper; Metal: Iron  | Metal                        | Iron                 | Keep Latest               |
+      | Mistborn              | Brandon Sanderson | Metal: Copper; Metal: Iron  | Metal                        | Copper, Iron         | Comma-separated Merge     |
+      | The Lord of the Rings | J. R. R. Tolkien  | Parts: First, second, third | Parts                        | First, second, third | (not set)                 |
 
   Scenario: Messages are separated into multiple flowfiles if the message demarcator is present in the message
     Given a ConsumeKafka processor set up in a "kafka-consumer-flow" flow
@@ -389,10 +398,10 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
 
     Then after a wait of <polling time>, at least <min expected messages> and at most <max expected messages> flowfiles are produced and placed in the monitored directory
 
-  Examples: Message batching
-    | max poll records | scheduling period | polling time | min expected messages | max expected messages |
-    | 3                | 5 sec             | 15 seconds   | 6                     | 12                    |
-    | 6                | 5 sec             | 15 seconds   | 12                    | 24                    |
+    Examples: Message batching
+      | max poll records | scheduling period | polling time | min expected messages | max expected messages |
+      | 3                | 5 sec             | 15 seconds   | 6                     | 12                    |
+      | 6                | 5 sec             | 15 seconds   | 12                    | 24                    |
 
   Scenario Outline: Unsupported encoding attributes for ConsumeKafka throw scheduling errors
     Given a ConsumeKafka processor set up in a "kafka-consumer-flow" flow
@@ -416,9 +425,9 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
   Scenario: ConsumeKafka receives data via SSL
     Given a ConsumeKafka processor set up in a "kafka-consumer-flow" flow
     And these processor properties are set:
-      | processor name | property name        | property value                             |
-      | ConsumeKafka   | Kafka Brokers        | kafka-broker-${feature_id}:9093            |
-      | ConsumeKafka   | Security Protocol    | ssl                                        |
+      | processor name | property name     | property value                  |
+      | ConsumeKafka   | Kafka Brokers     | kafka-broker-${feature_id}:9093 |
+      | ConsumeKafka   | Security Protocol | ssl                             |
     And a PutFile processor with the "Directory" property set to "/tmp/output" in the "kafka-consumer-flow" flow
     And an ssl context service is set up for ConsumeKafka
     And the "success" relationship of the ConsumeKafka processor is connected to the PutFile
@@ -434,12 +443,12 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
   Scenario: ConsumeKafka receives data via SASL SSL
     Given a ConsumeKafka processor set up in a "kafka-consumer-flow" flow
     And these processor properties are set:
-      | processor name | property name        | property value                             |
-      | ConsumeKafka   | Kafka Brokers        | kafka-broker-${feature_id}:9095            |
-      | ConsumeKafka   | Security Protocol    | sasl_ssl                                   |
-      | ConsumeKafka   | SASL Mechanism       | PLAIN                                      |
-      | ConsumeKafka   | Username             | alice                                      |
-      | ConsumeKafka   | Password             | alice-secret                               |
+      | processor name | property name     | property value                  |
+      | ConsumeKafka   | Kafka Brokers     | kafka-broker-${feature_id}:9095 |
+      | ConsumeKafka   | Security Protocol | sasl_ssl                        |
+      | ConsumeKafka   | SASL Mechanism    | PLAIN                           |
+      | ConsumeKafka   | Username          | alice                           |
+      | ConsumeKafka   | Password          | alice-secret                    |
     And a PutFile processor with the "Directory" property set to "/tmp/output" in the "kafka-consumer-flow" flow
     And an ssl context service is set up for ConsumeKafka
     And the "success" relationship of the ConsumeKafka processor is connected to the PutFile
@@ -457,12 +466,12 @@ Feature: Sending data to using Kafka streaming platform using PublishKafka
     And a PutFile processor with the "Directory" property set to "/tmp/output" in the "kafka-consumer-flow" flow
     And the "success" relationship of the ConsumeKafka processor is connected to the PutFile
     And these processor properties are set:
-      | processor name | property name        | property value                             |
-      | ConsumeKafka   | Kafka Brokers        | kafka-broker-${feature_id}:9094            |
-      | ConsumeKafka   | Security Protocol    | sasl_plaintext                             |
-      | ConsumeKafka   | SASL Mechanism       | PLAIN                                      |
-      | ConsumeKafka   | Username             | alice                                      |
-      | ConsumeKafka   | Password             | alice-secret                               |
+      | processor name | property name     | property value                  |
+      | ConsumeKafka   | Kafka Brokers     | kafka-broker-${feature_id}:9094 |
+      | ConsumeKafka   | Security Protocol | sasl_plaintext                  |
+      | ConsumeKafka   | SASL Mechanism    | PLAIN                           |
+      | ConsumeKafka   | Username          | alice                           |
+      | ConsumeKafka   | Password          | alice-secret                    |
 
     And a kafka broker is set up in correspondence with the third-party kafka publisher
 
diff --git a/extensions/librdkafka/CMakeLists.txt b/extensions/kafka/CMakeLists.txt
similarity index 76%
rename from extensions/librdkafka/CMakeLists.txt
rename to extensions/kafka/CMakeLists.txt
index 74fff6ced..08f400e2c 100644
--- a/extensions/librdkafka/CMakeLists.txt
+++ b/extensions/kafka/CMakeLists.txt
@@ -17,22 +17,24 @@
 # under the License.
 #
 
-if (NOT (ENABLE_ALL OR ENABLE_LIBRDKAFKA))
+if (NOT (ENABLE_ALL OR ENABLE_KAFKA))
     return()
-endif()
+endif ()
 
-include(BundledLibRdKafka)
-use_bundled_librdkafka(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
+include(Fetchlibrdkafka)
 
 include(${CMAKE_SOURCE_DIR}/extensions/ExtensionHeader.txt)
 
-file(GLOB SOURCES  "*.cpp")
+file(GLOB SOURCES "*.cpp")
 
 add_minifi_library(minifi-rdkafka-extensions SHARED ${SOURCES})
 
 target_link_libraries(minifi-rdkafka-extensions ${LIBMINIFI} Threads::Threads)
-target_link_libraries(minifi-rdkafka-extensions librdkafka)
 
-register_extension(minifi-rdkafka-extensions "RDKAFKA EXTENSIONS" RDKAFKA-EXTENSIONS "This Enables librdkafka functionality including PublishKafka" "extensions/librdkafka/tests")
+get_target_property(RDKAFKA_INCLUDE_DIRS rdkafka INCLUDE_DIRECTORIES)
+target_include_directories(minifi-rdkafka-extensions SYSTEM PUBLIC ${RDKAFKA_INCLUDE_DIRS})
+target_link_libraries(minifi-rdkafka-extensions rdkafka)
+
+register_extension(minifi-rdkafka-extensions "RDKAFKA EXTENSIONS" RDKAFKA-EXTENSIONS "This Enables librdkafka functionality including PublishKafka" "extensions/kafka/tests")
 
 register_extension_linter(minifi-rdkafka-extensions-linter)
diff --git a/extensions/librdkafka/ConsumeKafka.cpp b/extensions/kafka/ConsumeKafka.cpp
similarity index 68%
rename from extensions/librdkafka/ConsumeKafka.cpp
rename to extensions/kafka/ConsumeKafka.cpp
index 271cb5517..f173cc352 100644
--- a/extensions/librdkafka/ConsumeKafka.cpp
+++ b/extensions/kafka/ConsumeKafka.cpp
@@ -18,12 +18,11 @@
 #include "ConsumeKafka.h"
 
 #include <algorithm>
-#include <limits>
 
+#include "core/FlowFile.h"
 #include "core/ProcessSession.h"
 #include "core/PropertyType.h"
 #include "core/Resource.h"
-#include "FlowFileRecord.h"
 #include "utils/ProcessorConfigUtils.h"
 #include "utils/gsl.h"
 
@@ -34,8 +33,8 @@ namespace core {
 // The upper limit for Max Poll Time is 4 seconds. This is because Watchdog would potentially start
 // reporting issues with the processor health otherwise
 ValidationResult ConsumeKafkaMaxPollTimePropertyType::validate(const std::string& subject, const std::string& input) const {
-  auto parsed_value = utils::timeutils::StringToDuration<std::chrono::milliseconds>(input);
-  bool is_valid = parsed_value.has_value() && 0ms < *parsed_value && *parsed_value <= 4s;
+  const auto parsed_value = utils::timeutils::StringToDuration<std::chrono::milliseconds>(input);
+  const bool is_valid = parsed_value.has_value() && 0ms < *parsed_value && *parsed_value <= 4s;
   return ValidationResult{.valid = is_valid, .subject = subject, .input = input};
 }
 }  // namespace core
@@ -49,14 +48,14 @@ void ConsumeKafka::initialize() {
 
 void ConsumeKafka::onSchedule(core::ProcessContext& context, core::ProcessSessionFactory&) {
   // Required properties
-  kafka_brokers_                = utils::getRequiredPropertyOrThrow(context, KafkaBrokers.name);
-  topic_names_                  = utils::listFromRequiredCommaSeparatedProperty(context, TopicNames.name);
-  topic_name_format_            = utils::getRequiredPropertyOrThrow(context, TopicNameFormat.name);
-  honor_transactions_           = utils::parseBooleanPropertyOrThrow(context, HonorTransactions.name);
-  group_id_                     = utils::getRequiredPropertyOrThrow(context, GroupID.name);
-  offset_reset_                 = utils::getRequiredPropertyOrThrow(context, OffsetReset.name);
-  key_attribute_encoding_       = utils::getRequiredPropertyOrThrow(context, KeyAttributeEncoding.name);
-  max_poll_time_milliseconds_   = utils::parseTimePropertyMSOrThrow(context, MaxPollTime.name);
+  kafka_brokers_ = utils::getRequiredPropertyOrThrow(context, KafkaBrokers.name);
+  topic_names_ = utils::listFromRequiredCommaSeparatedProperty(context, TopicNames.name);
+  topic_name_format_ = utils::getRequiredPropertyOrThrow(context, TopicNameFormat.name);
+  honor_transactions_ = utils::parseBooleanPropertyOrThrow(context, HonorTransactions.name);
+  group_id_ = utils::getRequiredPropertyOrThrow(context, GroupID.name);
+  offset_reset_ = utils::getRequiredPropertyOrThrow(context, OffsetReset.name);
+  key_attribute_encoding_ = utils::getRequiredPropertyOrThrow(context, KeyAttributeEncoding.name);
+  max_poll_time_milliseconds_ = utils::parseTimePropertyMSOrThrow(context, MaxPollTime.name);
   session_timeout_milliseconds_ = utils::parseTimePropertyMSOrThrow(context, SessionTimeout.name);
 
   // Optional properties
@@ -65,13 +64,16 @@ void ConsumeKafka::onSchedule(core::ProcessContext& context, core::ProcessSessio
   context.getProperty(DuplicateHeaderHandling, duplicate_header_handling_);
 
   headers_to_add_as_attributes_ = utils::listFromCommaSeparatedProperty(context, HeadersToAddAsAttributes.name);
-  max_poll_records_ = gsl::narrow<std::size_t>(context.getProperty<uint64_t>(MaxPollRecords).value_or(core::StandardPropertyTypes::UNSIGNED_LONG_TYPE.parse(DEFAULT_MAX_POLL_RECORDS)));
+  max_poll_records_ = gsl::narrow<std::size_t>(context.getProperty<uint64_t>(MaxPollRecords)
+                                                   .value_or(core::StandardPropertyTypes::UNSIGNED_LONG_TYPE.parse(DEFAULT_MAX_POLL_RECORDS)));
 
-  if (!utils::string::equalsIgnoreCase(KEY_ATTR_ENCODING_UTF_8, key_attribute_encoding_) && !utils::string::equalsIgnoreCase(KEY_ATTR_ENCODING_HEX, key_attribute_encoding_)) {
+  if (!utils::string::equalsIgnoreCase(KEY_ATTR_ENCODING_UTF_8, key_attribute_encoding_) &&
+      !utils::string::equalsIgnoreCase(KEY_ATTR_ENCODING_HEX, key_attribute_encoding_)) {
     throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Unsupported key attribute encoding: " + key_attribute_encoding_);
   }
 
-  if (!utils::string::equalsIgnoreCase(MSG_HEADER_ENCODING_UTF_8, message_header_encoding_) && !utils::string::equalsIgnoreCase(MSG_HEADER_ENCODING_HEX, message_header_encoding_)) {
+  if (!utils::string::equalsIgnoreCase(MSG_HEADER_ENCODING_UTF_8, message_header_encoding_) &&
+      !utils::string::equalsIgnoreCase(MSG_HEADER_ENCODING_HEX, message_header_encoding_)) {
     throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Unsupported message header encoding: " + key_attribute_encoding_);
   }
 
@@ -87,18 +89,14 @@ void rebalance_cb(rd_kafka_t* rk, rd_kafka_resp_err_t trigger, rd_kafka_topic_pa
   switch (trigger) {
     case RD_KAFKA_RESP_ERR__ASSIGN_PARTITIONS:
       logger->log_debug("assigned:");
-      if (logger->should_log(core::logging::LOG_LEVEL::debug)) {
-        utils::print_topics_list(*logger, *partitions);
-      }
+      if (logger->should_log(core::logging::LOG_LEVEL::debug)) { utils::print_topics_list(*logger, *partitions); }
       assign_error = rd_kafka_assign(rk, partitions);
       break;
 
     case RD_KAFKA_RESP_ERR__REVOKE_PARTITIONS:
       logger->log_debug("revoked:");
-      rd_kafka_commit(rk, partitions, /* async = */ 0);  // Sync commit, maybe unneccessary
-      if (logger->should_log(core::logging::LOG_LEVEL::debug)) {
-        utils::print_topics_list(*logger, *partitions);
-      }
+      rd_kafka_commit(rk, partitions, /* async = */ 0);  // Sync commit, maybe unnecessary
+      if (logger->should_log(core::logging::LOG_LEVEL::debug)) { utils::print_topics_list(*logger, *partitions); }
       assign_error = rd_kafka_assign(rk, nullptr);
       break;
 
@@ -112,16 +110,17 @@ void rebalance_cb(rd_kafka_t* rk, rd_kafka_resp_err_t trigger, rd_kafka_topic_pa
 }  // namespace
 
 void ConsumeKafka::create_topic_partition_list() {
-  kf_topic_partition_list_ = { rd_kafka_topic_partition_list_new(gsl::narrow<int>(topic_names_.size())), utils::rd_kafka_topic_partition_list_deleter() };
+  kf_topic_partition_list_ = utils::rd_kafka_topic_partition_list_unique_ptr{
+      rd_kafka_topic_partition_list_new(gsl::narrow<int>(topic_names_.size()))};
 
   // On subscriptions any topics prefixed with ^ will be regex matched
   if (utils::string::equalsIgnoreCase(TOPIC_FORMAT_PATTERNS, topic_name_format_)) {
-    for (const std::string& topic : topic_names_) {
+    for (const std::string& topic: topic_names_) {
       const std::string regex_format = "^" + topic;
       rd_kafka_topic_partition_list_add(kf_topic_partition_list_.get(), regex_format.c_str(), RD_KAFKA_PARTITION_UA);
     }
   } else {
-    for (const std::string& topic : topic_names_) {
+    for (const std::string& topic: topic_names_) {
       rd_kafka_topic_partition_list_add(kf_topic_partition_list_.get(), topic.c_str(), RD_KAFKA_PARTITION_UA);
     }
   }
@@ -140,11 +139,12 @@ void ConsumeKafka::extend_config_from_dynamic_properties(const core::ProcessCont
   using utils::setKafkaConfigurationField;
 
   const std::vector<std::string> dynamic_prop_keys = context.getDynamicPropertyKeys();
-  if (dynamic_prop_keys.empty()) {
-    return;
-  }
-  logger_->log_info("Loading {} extra kafka configuration fields from ConsumeKafka dynamic properties:", dynamic_prop_keys.size());
-  for (const std::string& key : dynamic_prop_keys) {
+  if (dynamic_prop_keys.empty()) { return; }
+  logger_->log_info(
+      "Loading {} extra kafka configuration fields from ConsumeKafka dynamic "
+      "properties:",
+      dynamic_prop_keys.size());
+  for (const std::string& key: dynamic_prop_keys) {
     std::string value;
     gsl_Expects(context.getDynamicProperty(key, value));
     logger_->log_info("{}: {}", key.c_str(), value.c_str());
@@ -155,15 +155,14 @@ void ConsumeKafka::extend_config_from_dynamic_properties(const core::ProcessCont
 void ConsumeKafka::configure_new_connection(core::ProcessContext& context) {
   using utils::setKafkaConfigurationField;
 
-  conf_ = { rd_kafka_conf_new(), utils::rd_kafka_conf_deleter() };
-  if (conf_ == nullptr) {
-    throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Failed to create rd_kafka_conf_t object");
-  }
+  conf_ = {rd_kafka_conf_new(), utils::rd_kafka_conf_deleter()};
+  if (conf_ == nullptr) { throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Failed to create rd_kafka_conf_t object"); }
 
   // Set rebalance callback for use with coordinated consumer group balancing
   // Rebalance handlers are needed for the initial configuration of the consumer
   // If they are not set, offset reset is ignored and polling produces messages
-  // Registering a rebalance_cb turns off librdkafka's automatic partition assignment/revocation and instead delegates that responsibility to the application's rebalance_cb.
+  // Registering a rebalance_cb turns off librdkafka's automatic partition assignment/revocation and instead delegates that
+  // responsibility to the application's rebalance_cb.
   rd_kafka_conf_set_rebalance_cb(conf_.get(), rebalance_cb);
 
   // Uncomment this for librdkafka debug logs:
@@ -180,7 +179,8 @@ void ConsumeKafka::configure_new_connection(core::ProcessContext& context) {
   setKafkaConfigurationField(*conf_, "isolation.level", honor_transactions_ ? "read_committed" : "read_uncommitted");
   setKafkaConfigurationField(*conf_, "group.id", group_id_);
   setKafkaConfigurationField(*conf_, "session.timeout.ms", std::to_string(session_timeout_milliseconds_.count()));
-  setKafkaConfigurationField(*conf_, "max.poll.interval.ms", "600000");  // Twice the default, arbitrarily chosen
+  // Twice the default, arbitrarily chosen
+  setKafkaConfigurationField(*conf_, "max.poll.interval.ms", "600000");
 
   // This is a librdkafka option, but the communication timeout is also specified in each of the
   // relevant API calls. Could be redundant, but it probably does not hurt to set this
@@ -189,9 +189,9 @@ void ConsumeKafka::configure_new_connection(core::ProcessContext& context) {
   extend_config_from_dynamic_properties(context);
 
   std::array<char, 512U> errstr{};
-  consumer_ = { rd_kafka_new(RD_KAFKA_CONSUMER, conf_.release(), errstr.data(), errstr.size()), utils::rd_kafka_consumer_deleter() };
+  consumer_ = {rd_kafka_new(RD_KAFKA_CONSUMER, conf_.release(), errstr.data(), errstr.size()), utils::rd_kafka_consumer_deleter()};
   if (consumer_ == nullptr) {
-    const std::string error_msg { errstr.data() };
+    const std::string error_msg{errstr.data()};
     throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Failed to create Kafka consumer " + error_msg);
   }
 
@@ -210,29 +210,30 @@ void ConsumeKafka::configure_new_connection(core::ProcessContext& context) {
 
   rd_kafka_resp_err_t poll_set_consumer_response = rd_kafka_poll_set_consumer(consumer_.get());
   if (RD_KAFKA_RESP_ERR_NO_ERROR != poll_set_consumer_response) {
-    logger_->log_error("rd_kafka_poll_set_consumer error {}: {}", magic_enum::enum_underlying(poll_set_consumer_response), rd_kafka_err2str(poll_set_consumer_response));
+    logger_->log_error("rd_kafka_poll_set_consumer error {}: {}",
+        magic_enum::enum_underlying(poll_set_consumer_response),
+        rd_kafka_err2str(poll_set_consumer_response));
   }
 }
 
 std::string ConsumeKafka::extract_message(const rd_kafka_message_t& rkmessage) {
   if (RD_KAFKA_RESP_ERR_NO_ERROR != rkmessage.err) {
-    throw minifi::Exception(ExceptionType::PROCESSOR_EXCEPTION, "ConsumeKafka: received error message from broker: " + std::to_string(rkmessage.err) + " " + rd_kafka_err2str(rkmessage.err));
+    throw minifi::Exception(ExceptionType::PROCESSOR_EXCEPTION,
+        "ConsumeKafka: received error message from broker: " + std::to_string(rkmessage.err) + " " + rd_kafka_err2str(rkmessage.err));
   }
-  return { reinterpret_cast<char*>(rkmessage.payload), rkmessage.len };
+  return {static_cast<char*>(rkmessage.payload), rkmessage.len};
 }
 
-std::vector<std::unique_ptr<rd_kafka_message_t, utils::rd_kafka_message_deleter>> ConsumeKafka::poll_kafka_messages() {
-  std::vector<std::unique_ptr<rd_kafka_message_t, utils::rd_kafka_message_deleter>> messages;
+std::vector<utils::rd_kafka_message_unique_ptr> ConsumeKafka::poll_kafka_messages() {
+  std::vector<utils::rd_kafka_message_unique_ptr> messages;
   messages.reserve(max_poll_records_);
   const auto start = std::chrono::steady_clock::now();
   auto elapsed = std::chrono::steady_clock::now() - start;
   while (messages.size() < max_poll_records_ && elapsed < max_poll_time_milliseconds_) {
     logger_->log_debug("Polling for new messages for {}...", max_poll_time_milliseconds_);
     const auto timeout_ms = gsl::narrow<int>(std::chrono::duration_cast<std::chrono::milliseconds>(max_poll_time_milliseconds_ - elapsed).count());
-    std::unique_ptr<rd_kafka_message_t, utils::rd_kafka_message_deleter> message{rd_kafka_consumer_poll(consumer_.get(), timeout_ms)};
-    if (!message) {
-      break;
-    }
+    utils::rd_kafka_message_unique_ptr message{rd_kafka_consumer_poll(consumer_.get(), timeout_ms)};
+    if (!message) { break; }
     if (RD_KAFKA_RESP_ERR_NO_ERROR != message->err) {
       logger_->log_error("Received message with error {}: {}", magic_enum::enum_underlying(message->err), rd_kafka_err2str(message->err));
       break;
@@ -245,35 +246,21 @@ std::vector<std::unique_ptr<rd_kafka_message_t, utils::rd_kafka_message_deleter>
 }
 
 utils::KafkaEncoding ConsumeKafka::key_attr_encoding_attr_to_enum() const {
-  if (utils::string::equalsIgnoreCase(key_attribute_encoding_, KEY_ATTR_ENCODING_UTF_8)) {
-    return utils::KafkaEncoding::UTF8;
-  }
-  if (utils::string::equalsIgnoreCase(key_attribute_encoding_, KEY_ATTR_ENCODING_HEX)) {
-    return utils::KafkaEncoding::HEX;
-  }
+  if (utils::string::equalsIgnoreCase(key_attribute_encoding_, KEY_ATTR_ENCODING_UTF_8)) { return utils::KafkaEncoding::UTF8; }
+  if (utils::string::equalsIgnoreCase(key_attribute_encoding_, KEY_ATTR_ENCODING_HEX)) { return utils::KafkaEncoding::HEX; }
   throw minifi::Exception(ExceptionType::PROCESSOR_EXCEPTION, "\"Key Attribute Encoding\" property not recognized.");
 }
 
 utils::KafkaEncoding ConsumeKafka::message_header_encoding_attr_to_enum() const {
-  if (utils::string::equalsIgnoreCase(message_header_encoding_, MSG_HEADER_ENCODING_UTF_8)) {
-    return utils::KafkaEncoding::UTF8;
-  }
-  if (utils::string::equalsIgnoreCase(message_header_encoding_, MSG_HEADER_ENCODING_HEX)) {
-    return utils::KafkaEncoding::HEX;
-  }
+  if (utils::string::equalsIgnoreCase(message_header_encoding_, MSG_HEADER_ENCODING_UTF_8)) { return utils::KafkaEncoding::UTF8; }
+  if (utils::string::equalsIgnoreCase(message_header_encoding_, MSG_HEADER_ENCODING_HEX)) { return utils::KafkaEncoding::HEX; }
   throw minifi::Exception(ExceptionType::PROCESSOR_EXCEPTION, "\"Message Header Encoding\" property not recognized.");
 }
 
 std::string ConsumeKafka::resolve_duplicate_headers(const std::vector<std::string>& matching_headers) const {
-  if (MSG_HEADER_KEEP_FIRST == duplicate_header_handling_) {
-    return matching_headers.front();
-  }
-  if (MSG_HEADER_KEEP_LATEST == duplicate_header_handling_) {
-    return matching_headers.back();
-  }
-  if (MSG_HEADER_COMMA_SEPARATED_MERGE == duplicate_header_handling_) {
-    return utils::string::join(", ", matching_headers);
-  }
+  if (MSG_HEADER_KEEP_FIRST == duplicate_header_handling_) { return matching_headers.front(); }
+  if (MSG_HEADER_KEEP_LATEST == duplicate_header_handling_) { return matching_headers.back(); }
+  if (MSG_HEADER_COMMA_SEPARATED_MERGE == duplicate_header_handling_) { return utils::string::join(", ", matching_headers); }
   throw minifi::Exception(ExceptionType::PROCESSOR_EXCEPTION, "\"Duplicate Header Handling\" property not recognized.");
 }
 
@@ -282,17 +269,18 @@ std::vector<std::string> ConsumeKafka::get_matching_headers(const rd_kafka_messa
   // Detaching them using rd_kafka_message_detach_headers does not seem to work
   rd_kafka_headers_t* headers_raw = nullptr;
   const rd_kafka_resp_err_t get_header_response = rd_kafka_message_headers(&message, &headers_raw);
-  if (RD_KAFKA_RESP_ERR__NOENT == get_header_response) {
-    return {};
-  }
+  if (RD_KAFKA_RESP_ERR__NOENT == get_header_response) { return {}; }
   if (RD_KAFKA_RESP_ERR_NO_ERROR != get_header_response) {
-    logger_->log_error("Failed to fetch message headers: {}: {}", magic_enum::enum_underlying(rd_kafka_last_error()), rd_kafka_err2str(rd_kafka_last_error()));
+    logger_->log_error("Failed to fetch message headers: {}: {}",
+        magic_enum::enum_underlying(rd_kafka_last_error()),
+        rd_kafka_err2str(rd_kafka_last_error()));
   }
   std::vector<std::string> matching_headers;
   for (std::size_t header_idx = 0;; ++header_idx) {
     const char* value = nullptr;  // Not to be freed
     std::size_t size = 0;
-    if (RD_KAFKA_RESP_ERR_NO_ERROR != rd_kafka_header_get(headers_raw, header_idx, header_name.c_str(), reinterpret_cast<const void**>(&value), &size)) {
+    if (RD_KAFKA_RESP_ERR_NO_ERROR !=
+        rd_kafka_header_get(headers_raw, header_idx, header_name.c_str(), reinterpret_cast<const void**>(&value), &size)) {
       break;
     }
     if (size < 200) {
@@ -307,37 +295,37 @@ std::vector<std::string> ConsumeKafka::get_matching_headers(const rd_kafka_messa
 
 std::vector<std::pair<std::string, std::string>> ConsumeKafka::get_flowfile_attributes_from_message_header(const rd_kafka_message_t& message) const {
   std::vector<std::pair<std::string, std::string>> attributes_from_headers;
-  for (const std::string& header_name : headers_to_add_as_attributes_) {
+  for (const std::string& header_name: headers_to_add_as_attributes_) {
     const std::vector<std::string> matching_headers = get_matching_headers(message, header_name);
     if (!matching_headers.empty()) {
-      attributes_from_headers.emplace_back(header_name, utils::get_encoded_string(resolve_duplicate_headers(matching_headers), message_header_encoding_attr_to_enum()));
+      attributes_from_headers.emplace_back(header_name,
+          utils::get_encoded_string(resolve_duplicate_headers(matching_headers), message_header_encoding_attr_to_enum()));
     }
   }
   return attributes_from_headers;
 }
 
-void ConsumeKafka::add_kafka_attributes_to_flowfile(std::shared_ptr<FlowFileRecord>& flow_file, const rd_kafka_message_t& message) const {
+void ConsumeKafka::add_kafka_attributes_to_flowfile(core::FlowFile& flow_file, const rd_kafka_message_t& message) const {
   // We do not currently support batching messages into a single flowfile
-  flow_file->setAttribute(KAFKA_COUNT_ATTR, "1");
-  const std::optional<std::string> message_key = utils::get_encoded_message_key(message, key_attr_encoding_attr_to_enum());
-  if (message_key) {
-    flow_file->setAttribute(KAFKA_MESSAGE_KEY_ATTR, message_key.value());
+  flow_file.setAttribute(KAFKA_COUNT_ATTR, "1");
+  if (const auto message_key = utils::get_encoded_message_key(message, key_attr_encoding_attr_to_enum())) {
+    flow_file.setAttribute(KAFKA_MESSAGE_KEY_ATTR, *message_key);
   }
-  flow_file->setAttribute(KAFKA_OFFSET_ATTR, std::to_string(message.offset));
-  flow_file->setAttribute(KAFKA_PARTITION_ATTR, std::to_string(message.partition));
-  flow_file->setAttribute(KAFKA_TOPIC_ATTR, rd_kafka_topic_name(message.rkt));
+  flow_file.setAttribute(KAFKA_OFFSET_ATTR, std::to_string(message.offset));
+  flow_file.setAttribute(KAFKA_PARTITION_ATTR, std::to_string(message.partition));
+  flow_file.setAttribute(KAFKA_TOPIC_ATTR, rd_kafka_topic_name(message.rkt));
 }
 
-std::optional<std::vector<std::shared_ptr<FlowFileRecord>>> ConsumeKafka::transform_pending_messages_into_flowfiles(core::ProcessSession& session) const {
-  std::vector<std::shared_ptr<FlowFileRecord>> flow_files_created;
-  for (const auto& message : pending_messages_) {
+std::optional<std::vector<std::shared_ptr<core::FlowFile>>> ConsumeKafka::transform_pending_messages_into_flowfiles(core::ProcessSession& session)
+    const {
+  std::vector<std::shared_ptr<core::FlowFile>> flow_files_created;
+  for (const auto& message: pending_messages_) {
     std::string message_content = extract_message(*message);
     std::vector<std::pair<std::string, std::string>> attributes_from_headers = get_flowfile_attributes_from_message_header(*message);
-    std::vector<std::string> split_message{ !message_demarcator_.empty() ?
-      utils::string::split(message_content, message_demarcator_) :
-      std::vector<std::string>{ message_content }};
-    for (auto& flowfile_content : split_message) {
-      std::shared_ptr<FlowFileRecord> flow_file = std::static_pointer_cast<FlowFileRecord>(session.create());
+    std::vector<std::string> split_message{
+        !message_demarcator_.empty() ? utils::string::split(message_content, message_demarcator_) : std::vector<std::string>{message_content}};
+    for (auto& flowfile_content: split_message) {
+      auto flow_file = session.create();
       if (flow_file == nullptr) {
         logger_->log_error("Failed to create flowfile.");
         // Either transform all flowfiles or none
@@ -345,25 +333,18 @@ std::optional<std::vector<std::shared_ptr<FlowFileRecord>>> ConsumeKafka::transf
       }
       // flowfile content is consumed here
       session.writeBuffer(flow_file, flowfile_content);
-      for (const auto& kv : attributes_from_headers) {
-        flow_file->setAttribute(kv.first, kv.second);
-      }
-      add_kafka_attributes_to_flowfile(flow_file, *message);
+      for (const auto& kv: attributes_from_headers) { flow_file->setAttribute(kv.first, kv.second); }
+      add_kafka_attributes_to_flowfile(*flow_file, *message);
       flow_files_created.emplace_back(std::move(flow_file));
     }
   }
-  return { flow_files_created };
+  return {flow_files_created};
 }
 
-
 void ConsumeKafka::process_pending_messages(core::ProcessSession& session) {
-  std::optional<std::vector<std::shared_ptr<FlowFileRecord>>> flow_files_created = transform_pending_messages_into_flowfiles(session);
-  if (!flow_files_created) {
-    return;
-  }
-  for (const auto& flow_file : flow_files_created.value()) {
-    session.transfer(flow_file, Success);
-  }
+  std::optional<std::vector<std::shared_ptr<core::FlowFile>>> flow_files_created = transform_pending_messages_into_flowfiles(session);
+  if (!flow_files_created) { return; }
+  for (const auto& flow_file: flow_files_created.value()) { session.transfer(flow_file, Success); }
   session.commit();
   // Commit the offset from the latest message only
   if (RD_KAFKA_RESP_ERR_NO_ERROR != rd_kafka_commit_message(consumer_.get(), pending_messages_.back().get(), /* async = */ 0)) {
@@ -382,9 +363,7 @@ void ConsumeKafka::onTrigger(core::ProcessContext&, core::ProcessSession& sessio
   }
 
   pending_messages_ = poll_kafka_messages();
-  if (pending_messages_.empty()) {
-    return;
-  }
+  if (pending_messages_.empty()) { return; }
   process_pending_messages(session);
 }
 
diff --git a/extensions/kafka/ConsumeKafka.h b/extensions/kafka/ConsumeKafka.h
new file mode 100644
index 000000000..616c4eb95
--- /dev/null
+++ b/extensions/kafka/ConsumeKafka.h
@@ -0,0 +1,313 @@
+/**
+ * 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.
+ */
+
+#pragma once
+
+#include <memory>
+#include <optional>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "KafkaConnection.h"
+#include "KafkaProcessorBase.h"
+#include "core/PropertyDefinition.h"
+#include "core/PropertyDefinitionBuilder.h"
+#include "core/PropertyType.h"
+#include "core/RelationshipDefinition.h"
+#include "core/logging/LoggerConfiguration.h"
+#include "io/StreamPipe.h"
+#include "rdkafka.h"
+#include "rdkafka_utils.h"
+#include "utils/ArrayUtils.h"
+
+namespace org::apache::nifi::minifi {
+
+namespace core {
+class ConsumeKafkaMaxPollTimePropertyType : public TimePeriodPropertyType {
+ public:
+  constexpr ~ConsumeKafkaMaxPollTimePropertyType() override {}  // NOLINT see comment at grandparent
+
+  [[nodiscard]] ValidationResult validate(const std::string& subject, const std::string& input) const override;
+};
+
+inline constexpr ConsumeKafkaMaxPollTimePropertyType CONSUME_KAFKA_MAX_POLL_TIME_TYPE{};
+}  // namespace core
+
+namespace processors {
+
+class ConsumeKafka final : public KafkaProcessorBase {
+ public:
+  // Security Protocol allowable values
+  static constexpr std::string_view SECURITY_PROTOCOL_PLAINTEXT = "plaintext";
+  static constexpr std::string_view SECURITY_PROTOCOL_SSL = "ssl";
+
+  // Topic Name Format allowable values
+  static constexpr std::string_view TOPIC_FORMAT_NAMES = "Names";
+  static constexpr std::string_view TOPIC_FORMAT_PATTERNS = "Patterns";
+
+  // Offset Reset allowable values
+  static constexpr std::string_view OFFSET_RESET_EARLIEST = "earliest";
+  static constexpr std::string_view OFFSET_RESET_LATEST = "latest";
+  static constexpr std::string_view OFFSET_RESET_NONE = "none";
+
+  // Key Attribute Encoding allowable values
+  static constexpr std::string_view KEY_ATTR_ENCODING_UTF_8 = "UTF-8";
+  static constexpr std::string_view KEY_ATTR_ENCODING_HEX = "Hex";
+
+  // Message Header Encoding allowable values
+  static constexpr std::string_view MSG_HEADER_ENCODING_UTF_8 = "UTF-8";
+  static constexpr std::string_view MSG_HEADER_ENCODING_HEX = "Hex";
+
+  // Duplicate Header Handling allowable values
+  static constexpr std::string_view MSG_HEADER_KEEP_FIRST = "Keep First";
+  static constexpr std::string_view MSG_HEADER_KEEP_LATEST = "Keep Latest";
+  static constexpr std::string_view MSG_HEADER_COMMA_SEPARATED_MERGE = "Comma-separated Merge";
+
+  // Flowfile attributes written
+  static constexpr std::string_view KAFKA_COUNT_ATTR =
+      "kafka.count";  // Always 1 until we start supporting merging from batches
+  static constexpr std::string_view KAFKA_MESSAGE_KEY_ATTR = "kafka.key";
+  static constexpr std::string_view KAFKA_OFFSET_ATTR = "kafka.offset";
+  static constexpr std::string_view KAFKA_PARTITION_ATTR = "kafka.partition";
+  static constexpr std::string_view KAFKA_TOPIC_ATTR = "kafka.topic";
+
+  static constexpr std::string_view DEFAULT_MAX_POLL_RECORDS = "10000";
+  static constexpr std::string_view DEFAULT_MAX_POLL_TIME = "4 seconds";
+
+  static constexpr const std::size_t METADATA_COMMUNICATIONS_TIMEOUT_MS{60000};
+
+  EXTENSIONAPI static constexpr const char* Description =
+      "Consumes messages from Apache Kafka and transform them into MiNiFi FlowFiles. "
+      "The application should make sure that the processor is triggered at regular intervals, even if no messages are "
+      "expected, to serve any queued callbacks waiting to be called. Rebalancing can also only happen on trigger.";
+
+  EXTENSIONAPI static constexpr auto KafkaBrokers =
+      core::PropertyDefinitionBuilder<>::createProperty("Kafka Brokers")
+          .withDescription("A comma-separated list of known Kafka Brokers in the format <host>:<port>.")
+          .withPropertyType(core::StandardPropertyTypes::NON_BLANK_TYPE)
+          .withDefaultValue("localhost:9092")
+          .supportsExpressionLanguage(true)
+          .isRequired(true)
+          .build();
+  EXTENSIONAPI static constexpr auto TopicNames =
+      core::PropertyDefinitionBuilder<>::createProperty("Topic Names")
+          .withDescription(
+              "The name of the Kafka Topic(s) to pull from. Multiple topic names are supported as a comma separated list.")
+          .supportsExpressionLanguage(true)
+          .isRequired(true)
+          .build();
+  EXTENSIONAPI static constexpr auto TopicNameFormat =
+      core::PropertyDefinitionBuilder<2>::createProperty("Topic Name Format")
+          .withDescription(
+              "Specifies whether the Topic(s) provided are a comma separated list of names or a single regular expression. "
+              "Using regular expressions does not automatically discover Kafka topics created after the processor started.")
+          .withAllowedValues({TOPIC_FORMAT_NAMES, TOPIC_FORMAT_PATTERNS})
+          .withDefaultValue(TOPIC_FORMAT_NAMES)
+          .isRequired(true)
+          .build();
+  EXTENSIONAPI static constexpr auto HonorTransactions =
+      core::PropertyDefinitionBuilder<>::createProperty("Honor Transactions")
+          .withDescription(
+              "Specifies whether or not MiNiFi should honor transactional guarantees when communicating with Kafka. If "
+              "false, the Processor will use an \"isolation level\" of read_uncomitted. This means that messages will be "
+              "received as soon as they are written to Kafka but will be pulled, even if the producer cancels the "
+              "transactions. If this value is true, MiNiFi will not receive any messages for which the producer's "
+              "transaction was canceled, but this can result in some latency since the consumer must wait for the producer "
+              "to finish its entire transaction instead of pulling as the messages become available.")
+          .withPropertyType(core::StandardPropertyTypes::BOOLEAN_TYPE)
+          .withDefaultValue("true")
+          .isRequired(true)
+          .build();
+  EXTENSIONAPI static constexpr auto GroupID =
+      core::PropertyDefinitionBuilder<>::createProperty("Group ID")
+          .withDescription(
+              "A Group ID is used to identify consumers that are within the same consumer group. Corresponds to Kafka's "
+              "'group.id' property.")
+          .supportsExpressionLanguage(true)
+          .isRequired(true)
+          .build();
+  EXTENSIONAPI static constexpr auto OffsetReset =
+      core::PropertyDefinitionBuilder<3>::createProperty("Offset Reset")
+          .withDescription(
+              "Allows you to manage the condition when there is no initial offset in Kafka or if the current offset does "
+              "not exist any more on the server (e.g. because that data has been deleted). Corresponds to Kafka's "
+              "'auto.offset.reset' property.")
+          .withAllowedValues({OFFSET_RESET_EARLIEST, OFFSET_RESET_LATEST, OFFSET_RESET_NONE})
+          .withDefaultValue(OFFSET_RESET_LATEST)
+          .isRequired(true)
+          .build();
+  EXTENSIONAPI static constexpr auto KeyAttributeEncoding =
+      core::PropertyDefinitionBuilder<2>::createProperty("Key Attribute Encoding")
+          .withDescription(
+              "FlowFiles that are emitted have an attribute named 'kafka.key'. This property dictates how the value of the "
+              "attribute should be encoded.")
+          .withAllowedValues({KEY_ATTR_ENCODING_UTF_8, KEY_ATTR_ENCODING_HEX})
+          .withDefaultValue(KEY_ATTR_ENCODING_UTF_8)
+          .isRequired(true)
+          .build();
+  EXTENSIONAPI static constexpr auto MessageDemarcator =
+      core::PropertyDefinitionBuilder<>::createProperty("Message Demarcator")
+          .withDescription(
+              "Since KafkaConsumer receives messages in batches, you have an option to output FlowFiles which contains all "
+              "Kafka messages in a single batch for a given topic and partition and this property allows you to provide a "
+              "string (interpreted as UTF-8) to use for demarcating apart multiple Kafka messages. This is an optional "
+              "property and if not provided each Kafka message received will result in a single FlowFile which time it is "
+              "triggered. ")
+          .supportsExpressionLanguage(true)
+          .build();
+  EXTENSIONAPI static constexpr auto MessageHeaderEncoding =
+      core::PropertyDefinitionBuilder<2>::createProperty("Message Header Encoding")
+          .withDescription(
+              "Any message header that is found on a Kafka message will be added to the outbound FlowFile as an attribute. "
+              "This property indicates the Character Encoding to use for deserializing the headers.")
+          .withAllowedValues({MSG_HEADER_ENCODING_UTF_8, MSG_HEADER_ENCODING_HEX})
+          .withDefaultValue(MSG_HEADER_ENCODING_UTF_8)
+          .build();
+  EXTENSIONAPI static constexpr auto HeadersToAddAsAttributes =
+      core::PropertyDefinitionBuilder<>::createProperty("Headers To Add As Attributes")
+          .withDescription(
+              "A comma separated list to match against all message headers. Any message header whose name matches an item "
+              "from the list will be added to the FlowFile as an Attribute. If not specified, no Header values will be "
+              "added as FlowFile attributes. The behaviour on when multiple headers of the same name are present is set "
+              "using the Duplicate Header Handling attribute.")
+          .build();
+  EXTENSIONAPI static constexpr auto DuplicateHeaderHandling =
+      core::PropertyDefinitionBuilder<3>::createProperty("Duplicate Header Handling")
+          .withDescription(
+              "For headers to be added as attributes, this option specifies how to handle cases where multiple headers are "
+              "present with the same key. For example in case of receiving these two headers: \"Accept: text/html\" and "
+              "\"Accept: application/xml\" and we want to attach the value of \"Accept\" as a FlowFile attribute:\n - "
+              "\"Keep First\" attaches: \"Accept -> text/html\"\n - \"Keep Latest\" attaches: \"Accept -> "
+              "application/xml\"\n - \"Comma-separated Merge\" attaches: \"Accept -> text/html, application/xml\"\n")
+          .withAllowedValues({MSG_HEADER_KEEP_FIRST, MSG_HEADER_KEEP_LATEST, MSG_HEADER_COMMA_SEPARATED_MERGE})
+          .withDefaultValue(MSG_HEADER_KEEP_LATEST)  // Mirroring NiFi behaviour
+          .build();
+  EXTENSIONAPI static constexpr auto MaxPollRecords =
+      core::PropertyDefinitionBuilder<>::createProperty("Max Poll Records")
+          .withDescription(
+              "Specifies the maximum number of records Kafka should return when polling each time the processor is "
+              "triggered.")
+          .withPropertyType(core::StandardPropertyTypes::UNSIGNED_LONG_TYPE)
+          .withDefaultValue(DEFAULT_MAX_POLL_RECORDS)
+          .build();
+  EXTENSIONAPI static constexpr auto MaxPollTime =
+      core::PropertyDefinitionBuilder<>::createProperty("Max Poll Time")
+          .withDescription(
+              "Specifies the maximum amount of time the consumer can use for polling data from the brokers. Polling is a "
+              "blocking operation, so the upper limit of this value is specified in 4 seconds.")
+          .withPropertyType(core::CONSUME_KAFKA_MAX_POLL_TIME_TYPE)
+          .withDefaultValue(DEFAULT_MAX_POLL_TIME)
+          .isRequired(true)
+          .build();
+  EXTENSIONAPI static constexpr auto SessionTimeout =
+      core::PropertyDefinitionBuilder<>::createProperty("Session Timeout")
+          .withDescription(
+              "Client group session and failure detection timeout. The consumer sends periodic heartbeats to indicate its "
+              "liveness to the broker. If no hearts are received by the broker for a group member within the session "
+              "timeout, the broker will remove the consumer from the group and trigger a rebalance. The allowed range is "
+              "configured with the broker configuration properties group.min.session.timeout.ms and "
+              "group.max.session.timeout.ms.")
+          .withPropertyType(core::StandardPropertyTypes::TIME_PERIOD_TYPE)
+          .withDefaultValue("60 seconds")
+          .build();
+  EXTENSIONAPI static constexpr auto Properties = utils::array_cat(KafkaProcessorBase::Properties,
+      std::to_array<core::PropertyReference>({KafkaBrokers,
+          TopicNames,
+          TopicNameFormat,
+          HonorTransactions,
+          GroupID,
+          OffsetReset,
+          KeyAttributeEncoding,
+          MessageDemarcator,
+          MessageHeaderEncoding,
+          HeadersToAddAsAttributes,
+          DuplicateHeaderHandling,
+          MaxPollRecords,
+          MaxPollTime,
+          SessionTimeout}));
+
+  EXTENSIONAPI static constexpr auto Success = core::RelationshipDefinition{"success",
+      "Incoming Kafka messages as flowfiles. Depending on the demarcation strategy, this can be one or multiple flowfiles "
+      "per message."};
+  EXTENSIONAPI static constexpr auto Relationships = std::array{Success};
+
+  EXTENSIONAPI static constexpr bool SupportsDynamicProperties = true;
+  EXTENSIONAPI static constexpr bool SupportsDynamicRelationships = false;
+  EXTENSIONAPI static constexpr core::annotation::Input InputRequirement = core::annotation::Input::INPUT_FORBIDDEN;
+  EXTENSIONAPI static constexpr bool IsSingleThreaded = false;
+
+  ADD_COMMON_VIRTUAL_FUNCTIONS_FOR_PROCESSORS
+
+  explicit ConsumeKafka(const std::string_view name, const utils::Identifier& uuid = utils::Identifier())
+      : KafkaProcessorBase(name, uuid, core::logging::LoggerFactory<ConsumeKafka>::getLogger(uuid)) {}
+
+  ConsumeKafka(const ConsumeKafka&) = delete;
+  ConsumeKafka(ConsumeKafka&&) = delete;
+  ConsumeKafka& operator=(const ConsumeKafka&) = delete;
+  ConsumeKafka& operator=(ConsumeKafka&&) = delete;
+  ~ConsumeKafka() override = default;
+
+  void onSchedule(core::ProcessContext& context, core::ProcessSessionFactory& session_factory) override;
+  void onTrigger(core::ProcessContext& context, core::ProcessSession& session) override;
+  void initialize() override;
+
+ private:
+  void create_topic_partition_list();
+  void extend_config_from_dynamic_properties(const core::ProcessContext& context);
+  void configure_new_connection(core::ProcessContext& context);
+  static std::string extract_message(const rd_kafka_message_t& rkmessage);
+  std::vector<utils::rd_kafka_message_unique_ptr> poll_kafka_messages();
+  utils::KafkaEncoding key_attr_encoding_attr_to_enum() const;
+  utils::KafkaEncoding message_header_encoding_attr_to_enum() const;
+  std::string resolve_duplicate_headers(const std::vector<std::string>& matching_headers) const;
+  std::vector<std::string> get_matching_headers(const rd_kafka_message_t& message, const std::string& header_name) const;
+  std::vector<std::pair<std::string, std::string>> get_flowfile_attributes_from_message_header(
+      const rd_kafka_message_t& message) const;
+  void add_kafka_attributes_to_flowfile(core::FlowFile& flow_file, const rd_kafka_message_t& message) const;
+  std::optional<std::vector<std::shared_ptr<core::FlowFile>>> transform_pending_messages_into_flowfiles(
+      core::ProcessSession& session) const;
+  void process_pending_messages(core::ProcessSession& session);
+
+  std::string kafka_brokers_;
+  std::vector<std::string> topic_names_;
+  std::string topic_name_format_;
+  bool honor_transactions_{};
+  std::string group_id_;
+  std::string offset_reset_;
+  std::string key_attribute_encoding_;
+  std::string message_demarcator_;
+  std::string message_header_encoding_;
+  std::string duplicate_header_handling_;
+  std::vector<std::string> headers_to_add_as_attributes_;
+  std::size_t max_poll_records_{};
+  std::chrono::milliseconds max_poll_time_milliseconds_{};
+  std::chrono::milliseconds session_timeout_milliseconds_{};
+
+  utils::rd_kafka_consumer_unique_ptr consumer_;
+  utils::rd_kafka_conf_unique_ptr conf_;
+  utils::rd_kafka_topic_partition_list_unique_ptr kf_topic_partition_list_;
+
+  // Intermediate container type for messages that have been processed, but are
+  // not yet persisted (e.g. in case of I/O error)
+  std::vector<utils::rd_kafka_message_unique_ptr> pending_messages_;
+
+  std::mutex do_not_call_on_trigger_concurrently_;
+};
+
+}  // namespace processors
+}  // namespace org::apache::nifi::minifi
diff --git a/extensions/librdkafka/KafkaConnection.cpp b/extensions/kafka/KafkaConnection.cpp
similarity index 78%
rename from extensions/librdkafka/KafkaConnection.cpp
rename to extensions/kafka/KafkaConnection.cpp
index eb0423757..a7ec13040 100644
--- a/extensions/librdkafka/KafkaConnection.cpp
+++ b/extensions/kafka/KafkaConnection.cpp
@@ -28,9 +28,7 @@ KafkaConnection::KafkaConnection(KafkaConnectionKey key)
     : logger_(core::logging::LoggerFactory<KafkaConnection>::getLogger()),
       initialized_(false),
       key_(std::move(key)),
-      kafka_connection_(nullptr),
-      poll_(false) {
-}
+      poll_(false) {}
 
 KafkaConnection::~KafkaConnection() {
   remove();
@@ -60,12 +58,12 @@ bool KafkaConnection::initialized() const {
   return initialized_;
 }
 
-void KafkaConnection::setConnection(gsl::owner<rd_kafka_t*> producer) {
+void KafkaConnection::setConnection(utils::rd_kafka_producer_unique_ptr producer) {
   removeConnection();
-  kafka_connection_ = producer;  // kafka_connection_ takes ownership from producer
+  kafka_connection_ = gsl::owner<rd_kafka_t*>{producer.release()};  // kafka_connection_ takes ownership from producer
   initialized_ = true;
   modifyLoggers([&](std::unordered_map<const rd_kafka_t*, std::weak_ptr<core::logging::Logger>>& loggers) {
-    loggers[producer] = logger_;
+    loggers[kafka_connection_] = logger_;
   });
   startPoll();
 }
@@ -74,15 +72,12 @@ rd_kafka_t* KafkaConnection::getConnection() const {
   return static_cast<rd_kafka_t*>(kafka_connection_);
 }
 
-bool KafkaConnection::hasTopic(const std::string &topic) const {
+bool KafkaConnection::hasTopic(const std::string& topic) const {
   return topics_.contains(topic);
 }
 
-std::shared_ptr<KafkaTopic> KafkaConnection::getTopic(const std::string &topic) const {
-  auto topicObj = topics_.find(topic);
-  if (topicObj != topics_.end()) {
-    return topicObj->second;
-  }
+std::shared_ptr<KafkaTopic> KafkaConnection::getTopic(const std::string& topic) const {
+  if (const auto topicObj = topics_.find(topic); topicObj != topics_.end()) { return topicObj->second; }
   return nullptr;
 }
 
@@ -90,22 +85,19 @@ KafkaConnectionKey const* KafkaConnection::getKey() const {
   return &key_;
 }
 
-void KafkaConnection::putTopic(const std::string &topicName, const std::shared_ptr<KafkaTopic> &topic) {
+void KafkaConnection::putTopic(const std::string& topicName, const std::shared_ptr<KafkaTopic>& topic) {
   topics_[topicName] = topic;
 }
 
-void KafkaConnection::logCallback(const rd_kafka_t* rk, int level, const char* /*fac*/, const char* buf) {
+void KafkaConnection::logCallback(const rd_kafka_t* rk, const int level, const char* /*fac*/, const char* buf) {
   std::shared_ptr<core::logging::Logger> logger;
   try {
-    modifyLoggers([&](std::unordered_map<const rd_kafka_t*, std::weak_ptr<core::logging::Logger>>& loggers) {
+    modifyLoggers([&](const std::unordered_map<const rd_kafka_t*, std::weak_ptr<core::logging::Logger>>& loggers) {
       logger = loggers.at(rk).lock();
     });
-  } catch (...) {
-  }
+  } catch (...) {}
 
-  if (!logger) {
-    return;
-  }
+  if (!logger) { return; }
 
   switch (level) {
     case 0:  // LOG_EMERG
@@ -126,8 +118,7 @@ void KafkaConnection::logCallback(const rd_kafka_t* rk, int level, const char* /
     case 7:  // LOG_DEBUG
       logger->log_debug("{}", buf);
       break;
-    default:
-      gsl_FailFast();
+    default: gsl_FailFast();
   }
 }
 
diff --git a/extensions/librdkafka/KafkaConnection.h b/extensions/kafka/KafkaConnection.h
similarity index 85%
rename from extensions/librdkafka/KafkaConnection.h
rename to extensions/kafka/KafkaConnection.h
index 2bafb66fb..186c50647 100644
--- a/extensions/librdkafka/KafkaConnection.h
+++ b/extensions/kafka/KafkaConnection.h
@@ -50,6 +50,8 @@ class KafkaConnection {
 
   KafkaConnection(const KafkaConnection&) = delete;
   KafkaConnection& operator=(KafkaConnection) = delete;
+  KafkaConnection(KafkaConnection&&) = delete;
+  KafkaConnection& operator=(KafkaConnection&&) = delete;
 
   ~KafkaConnection();
 
@@ -57,17 +59,17 @@ class KafkaConnection {
 
   void removeConnection();
 
-  bool initialized() const;
+  [[nodiscard]] bool initialized() const;
 
-  void setConnection(gsl::owner<rd_kafka_t*> producer);
+  void setConnection(utils::rd_kafka_producer_unique_ptr producer);
 
-  rd_kafka_t* getConnection() const;
+  [[nodiscard]] rd_kafka_t* getConnection() const;
 
-  bool hasTopic(const std::string &topic) const;
+  [[nodiscard]] bool hasTopic(const std::string &topic) const;
 
-  std::shared_ptr<KafkaTopic> getTopic(const std::string &topic) const;
+  [[nodiscard]] std::shared_ptr<KafkaTopic> getTopic(const std::string &topic) const;
 
-  KafkaConnectionKey const* getKey() const;
+  [[nodiscard]] KafkaConnectionKey const* getKey() const;
 
   void putTopic(const std::string &topicName, const std::shared_ptr<KafkaTopic> &topic);
 
@@ -80,9 +82,9 @@ class KafkaConnection {
 
   KafkaConnectionKey key_;
 
-  std::map<std::string, std::shared_ptr<KafkaTopic>> topics_;
+  std::map<std::string, std::shared_ptr<KafkaTopic>> topics_{};
 
-  gsl::owner<rd_kafka_t*> kafka_connection_;
+  gsl::owner<rd_kafka_t*> kafka_connection_{};
 
   std::atomic<bool> poll_;
   std::thread thread_kafka_poll_;
diff --git a/extensions/librdkafka/KafkaProcessorBase.cpp b/extensions/kafka/KafkaProcessorBase.cpp
similarity index 85%
rename from extensions/librdkafka/KafkaProcessorBase.cpp
rename to extensions/kafka/KafkaProcessorBase.cpp
index c25a479f1..9eba09d9d 100644
--- a/extensions/librdkafka/KafkaProcessorBase.cpp
+++ b/extensions/kafka/KafkaProcessorBase.cpp
@@ -16,9 +16,9 @@
  */
 #include "KafkaProcessorBase.h"
 
+#include "controllers/SSLContextService.h"
 #include "rdkafka_utils.h"
 #include "utils/ProcessorConfigUtils.h"
-#include "controllers/SSLContextService.h"
 
 namespace org::apache::nifi::minifi::processors {
 
@@ -31,8 +31,7 @@ void KafkaProcessorBase::setKafkaAuthenticationParameters(core::ProcessContext&
   utils::setKafkaConfigurationField(*config, "security.protocol", std::string{magic_enum::enum_name(security_protocol_)});
   logger_->log_debug("Kafka security.protocol [{}]", magic_enum::enum_name(security_protocol_));
   if (security_protocol_ == kafka::SecurityProtocolOption::ssl || security_protocol_ == kafka::SecurityProtocolOption::sasl_ssl) {
-    auto ssl_data = getSslData(context);
-    if (ssl_data) {
+    if (auto ssl_data = getSslData(context)) {
       if (ssl_data->ca_loc.empty() && ssl_data->cert_loc.empty() && ssl_data->key_loc.empty() && ssl_data->key_pw.empty()) {
         logger_->log_warn("Security protocol is set to {}, but no valid security parameters are set in the properties or in the SSL Context Service.",
             magic_enum::enum_name(security_protocol_));
@@ -53,17 +52,18 @@ void KafkaProcessorBase::setKafkaAuthenticationParameters(core::ProcessContext&
   utils::setKafkaConfigurationField(*config, "sasl.mechanism", std::string{magic_enum::enum_name(sasl_mechanism)});
   logger_->log_debug("Kafka sasl.mechanism [{}]", magic_enum::enum_name(sasl_mechanism));
 
-  auto setKafkaConfigIfNotEmpty = [this, &context, config](const core::PropertyReference& property, const std::string& kafka_config_name, bool log_value = true) {
-    std::string value;
-    if (context.getProperty(property, value) && !value.empty()) {
-      utils::setKafkaConfigurationField(*config, kafka_config_name, value);
-      if (log_value) {
-        logger_->log_debug("Kafka {} [{}]", kafka_config_name, value);
-      } else {
-        logger_->log_debug("Kafka {} was set", kafka_config_name);
-      }
-    }
-  };
+  auto setKafkaConfigIfNotEmpty =
+      [this, &context, config](const core::PropertyReference& property, const std::string& kafka_config_name, bool log_value = true) {
+        std::string value;
+        if (context.getProperty(property, value) && !value.empty()) {
+          utils::setKafkaConfigurationField(*config, kafka_config_name, value);
+          if (log_value) {
+            logger_->log_debug("Kafka {} [{}]", kafka_config_name, value);
+          } else {
+            logger_->log_debug("Kafka {} was set", kafka_config_name);
+          }
+        }
+      };
 
   setKafkaConfigIfNotEmpty(KerberosServiceName, "sasl.kerberos.service.name");
   setKafkaConfigIfNotEmpty(KerberosPrincipal, "sasl.kerberos.principal");
diff --git a/extensions/kafka/KafkaProcessorBase.h b/extensions/kafka/KafkaProcessorBase.h
new file mode 100644
index 000000000..87f0fc78c
--- /dev/null
+++ b/extensions/kafka/KafkaProcessorBase.h
@@ -0,0 +1,110 @@
+/**
+ * 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.
+ */
+#pragma once
+
+#include <memory>
+#include <optional>
+#include <string_view>
+
+#include "controllers/SSLContextService.h"
+#include "core/Processor.h"
+#include "core/PropertyDefinitionBuilder.h"
+#include "rdkafka_utils.h"
+#include "utils/Enum.h"
+#include "utils/net/Ssl.h"
+
+namespace org::apache::nifi::minifi::processors {
+
+namespace kafka {
+enum class SecurityProtocolOption { plaintext, ssl, sasl_plaintext, sasl_ssl };
+
+enum class SASLMechanismOption { GSSAPI, PLAIN };
+}  // namespace kafka
+
+class KafkaProcessorBase : public core::Processor {
+ public:
+  EXTENSIONAPI static constexpr auto SSLContextService =
+      core::PropertyDefinitionBuilder<>::createProperty("SSL Context Service")
+          .withDescription("SSL Context Service Name")
+          .withAllowedTypes<minifi::controllers::SSLContextService>()
+          .build();
+  EXTENSIONAPI static constexpr auto SecurityProtocol =
+      core::PropertyDefinitionBuilder<magic_enum::enum_count<kafka::SecurityProtocolOption>()>::createProperty(
+          "Security Protocol")
+          .withDescription(
+              "Protocol used to communicate with brokers. Corresponds to "
+              "Kafka's 'security.protocol' property.")
+          .withDefaultValue(magic_enum::enum_name(kafka::SecurityProtocolOption::plaintext))
+          .withAllowedValues(magic_enum::enum_names<kafka::SecurityProtocolOption>())
+          .isRequired(true)
+          .build();
+  EXTENSIONAPI static constexpr auto KerberosServiceName =
+      core::PropertyDefinitionBuilder<>::createProperty("Kerberos Service Name")
+          .withDescription("Kerberos Service Name")
+          .build();
+  EXTENSIONAPI static constexpr auto KerberosPrincipal =
+      core::PropertyDefinitionBuilder<>::createProperty("Kerberos Principal").withDescription("Kerberos Principal").build();
+  EXTENSIONAPI static constexpr auto KerberosKeytabPath =
+      core::PropertyDefinitionBuilder<>::createProperty("Kerberos Keytab Path")
+          .withDescription(
+              "The path to the location on the local filesystem where the "
+              "kerberos keytab is located. Read permission on the file is "
+              "required.")
+          .build();
+  EXTENSIONAPI static constexpr auto SASLMechanism =
+      core::PropertyDefinitionBuilder<magic_enum::enum_count<kafka::SASLMechanismOption>()>::createProperty("SASL Mechanism")
+          .withDescription(
+              "The SASL mechanism to use for authentication. Corresponds to "
+              "Kafka's 'sasl.mechanism' property.")
+          .withDefaultValue(magic_enum::enum_name(kafka::SASLMechanismOption::GSSAPI))
+          .withAllowedValues(magic_enum::enum_names<kafka::SASLMechanismOption>())
+          .isRequired(true)
+          .build();
+  EXTENSIONAPI static constexpr auto Username =
+      core::PropertyDefinitionBuilder<>::createProperty("Username")
+          .withDescription("The username when the SASL Mechanism is sasl_plaintext")
+          .build();
+  EXTENSIONAPI static constexpr auto Password =
+      core::PropertyDefinitionBuilder<>::createProperty("Password")
+          .withDescription(
+              "The password for the given username when the SASL Mechanism is "
+              "sasl_plaintext")
+          .isSensitive(true)
+          .build();
+  EXTENSIONAPI static constexpr auto Properties = std::to_array<core::PropertyReference>({SSLContextService,
+      SecurityProtocol, KerberosServiceName, KerberosPrincipal, KerberosKeytabPath, SASLMechanism, Username, Password});
+
+  KafkaProcessorBase(
+      const std::string_view name, const utils::Identifier& uuid, std::shared_ptr<core::logging::Logger> logger)
+      : core::Processor(name, uuid),
+        logger_(std::move(logger)) {}
+
+  KafkaProcessorBase(const KafkaProcessorBase&) = delete;
+  KafkaProcessorBase(KafkaProcessorBase&&) = delete;
+  KafkaProcessorBase& operator=(const KafkaProcessorBase&) = delete;
+  KafkaProcessorBase& operator=(KafkaProcessorBase&&) = delete;
+  ~KafkaProcessorBase() override = default;
+
+ protected:
+  virtual std::optional<utils::net::SslData> getSslData(core::ProcessContext& context) const;
+  void setKafkaAuthenticationParameters(core::ProcessContext& context, gsl::not_null<rd_kafka_conf_t*> config);
+
+  kafka::SecurityProtocolOption security_protocol_{};
+  std::shared_ptr<core::logging::Logger> logger_;
+};
+
+}  // namespace org::apache::nifi::minifi::processors
diff --git a/extensions/librdkafka/KafkaTopic.h b/extensions/kafka/KafkaTopic.h
similarity index 53%
rename from extensions/librdkafka/KafkaTopic.h
rename to extensions/kafka/KafkaTopic.h
index ca79d7351..66d5b6399 100644
--- a/extensions/librdkafka/KafkaTopic.h
+++ b/extensions/kafka/KafkaTopic.h
@@ -15,43 +15,27 @@
  * limitations under the License.
  */
 
-#ifndef EXTENSIONS_LIBRDKAFKA_KAFKATOPIC_H_
-#define EXTENSIONS_LIBRDKAFKA_KAFKATOPIC_H_
+#pragma once
 
-#include "rdkafka.h"
+#include "rdkafka_utils.h"
 
-#include "utils/gsl.h"
-
-namespace org {
-namespace apache {
-namespace nifi {
-namespace minifi {
-namespace processors {
+namespace org::apache::nifi::minifi::processors {
 
 class KafkaTopic {
  public:
-  explicit KafkaTopic(gsl::owner<rd_kafka_topic_t*> topic_reference)
-      : topic_reference_(topic_reference) {
-  }
+  explicit KafkaTopic(utils::rd_kafka_topic_unique_ptr&& topic_reference) : topic_reference_(std::move(topic_reference)) {}
+
+  KafkaTopic(const KafkaTopic&) = delete;
+  KafkaTopic& operator=(const KafkaTopic&) = delete;
+  KafkaTopic(KafkaTopic&&) = delete;
+  KafkaTopic& operator=(KafkaTopic&&) = delete;
 
-  ~KafkaTopic() {
-    if (topic_reference_) {
-      rd_kafka_topic_destroy(topic_reference_);
-    }
-  }
+  ~KafkaTopic() = default;
 
-  rd_kafka_topic_t *getTopic() const {
-    return topic_reference_;
-  }
+  [[nodiscard]] rd_kafka_topic_t* getTopic() const { return topic_reference_.get(); }
 
  private:
-  gsl::owner<rd_kafka_topic_t*> topic_reference_;
+  utils::rd_kafka_topic_unique_ptr topic_reference_;
 };
 
-}  // namespace processors
-}  // namespace minifi
-}  // namespace nifi
-}  // namespace apache
-}  // namespace org
-
-#endif  // EXTENSIONS_LIBRDKAFKA_KAFKATOPIC_H_
+}  // namespace org::apache::nifi::minifi::processors
diff --git a/extensions/librdkafka/PublishKafka.cpp b/extensions/kafka/PublishKafka.cpp
similarity index 58%
rename from extensions/librdkafka/PublishKafka.cpp
rename to extensions/kafka/PublishKafka.cpp
index 657b452f5..894ef9d1b 100644
--- a/extensions/librdkafka/PublishKafka.cpp
+++ b/extensions/kafka/PublishKafka.cpp
@@ -16,37 +16,25 @@
  */
 #include "PublishKafka.h"
 
-#include <cstdio>
-#include <algorithm>
-#include <memory>
-#include <string>
 #include <map>
 #include <set>
-#include <type_traits>
+#include <string>
 #include <vector>
 
-#include "utils/gsl.h"
-#include "utils/StringUtils.h"
 #include "core/ProcessContext.h"
 #include "core/ProcessSession.h"
 #include "core/Resource.h"
+#include "range/v3/algorithm/all_of.hpp"
+#include "rdkafka_utils.h"
+#include "utils/ProcessorConfigUtils.h"
+#include "utils/StringUtils.h"
+#include "utils/gsl.h"
 
 namespace org::apache::nifi::minifi::processors {
 
 namespace {
-struct rd_kafka_conf_deleter {
-  void operator()(rd_kafka_conf_t* p) const noexcept { rd_kafka_conf_destroy(p); }
-};
-struct rd_kafka_topic_conf_deleter {
-  void operator()(rd_kafka_topic_conf_t* p) const noexcept { rd_kafka_topic_conf_destroy(p); }
-};
-
 // Message
-enum class MessageStatus : uint8_t {
-  InFlight,
-  Error,
-  Success
-};
+enum class MessageStatus : uint8_t { InFlight, Error, Success };
 
 const char* to_string(const MessageStatus s) {
   switch (s) {
@@ -77,27 +65,29 @@ class PublishKafka::Messages {
 
   [[nodiscard]] std::string logStatus(const std::unique_lock<std::mutex>& lock) const {
     gsl_Expects(lock.owns_lock());
-    const auto messageresult_ok = [](const MessageResult r) { return r.status == MessageStatus::Success && r.err_code == RD_KAFKA_RESP_ERR_NO_ERROR; };
-    const auto messageresult_inflight = [](const MessageResult r) { return r.status == MessageStatus::InFlight && r.err_code == RD_KAFKA_RESP_ERR_NO_ERROR; };
+    const auto messageresult_ok = [](const MessageResult r) {
+      return r.status == MessageStatus::Success && r.err_code == RD_KAFKA_RESP_ERR_NO_ERROR;
+    };
+    const auto messageresult_inflight = [](const MessageResult r) {
+      return r.status == MessageStatus::InFlight && r.err_code == RD_KAFKA_RESP_ERR_NO_ERROR;
+    };
     std::vector<size_t> flow_files_in_flight;
     std::ostringstream oss;
     if (interrupted_) { oss << "interrupted, "; }
     for (size_t ffi = 0; ffi < flow_files_.size(); ++ffi) {
-      const auto& flow_file = flow_files_[ffi];
-      if (!flow_file.flow_file_error && std::all_of(std::begin(flow_file.messages), std::end(flow_file.messages), messageresult_ok)) {
+      const auto& [flow_file_error, messages] = flow_files_[ffi];
+      if (!flow_file_error && ranges::all_of(messages, messageresult_ok)) {
         continue;  // don't log the happy path to reduce log spam
       }
-      if (!flow_file.flow_file_error && std::all_of(std::begin(flow_file.messages), std::end(flow_file.messages), messageresult_inflight)) {
+      if (!flow_file_error && ranges::all_of(messages, messageresult_inflight)) {
         flow_files_in_flight.push_back(ffi);
         continue;  // don't log fully in-flight flow files here, log them at the end instead
       }
       oss << '[' << ffi << "]: {";
-      if (flow_file.flow_file_error) { oss << "error, "; }
-      for (size_t msgi = 0; msgi < flow_file.messages.size(); ++msgi) {
-        const auto& msg = flow_file.messages[msgi];
-        if (messageresult_ok(msg)) {
-          continue;
-        }
+      if (flow_file_error) { oss << "error, "; }
+      for (size_t msgi = 0; msgi < messages.size(); ++msgi) {
+        const auto& msg = messages[msgi];
+        if (messageresult_ok(msg)) { continue; }
         oss << '<' << msgi << ">: (msg " << to_string(msg.status) << ", " << rd_kafka_err2str(msg.err_code) << "), ";
       }
       oss << "}, ";
@@ -107,16 +97,14 @@ class PublishKafka::Messages {
   }
 
  public:
-  explicit Messages(std::shared_ptr<core::logging::Logger> logger) :logger_{std::move(logger)} {}
+  explicit Messages(std::shared_ptr<core::logging::Logger> logger) : logger_{std::move(logger)} {}
 
   void waitForCompletion() {
     std::unique_lock<std::mutex> lock(mutex_);
     cv_.wait(lock, [this, &lock] {
-      if (logger_->should_log(core::logging::LOG_LEVEL::trace)) {
-        logger_->log_trace("{}", logStatus(lock));
-      }
-      return interrupted_ || std::all_of(std::begin(this->flow_files_), std::end(this->flow_files_), [](const FlowFileResult& flow_file) {
-        return flow_file.flow_file_error || std::all_of(std::begin(flow_file.messages), std::end(flow_file.messages), [](const MessageResult& message) {
+      if (logger_->should_log(core::logging::LOG_LEVEL::trace)) { logger_->log_trace("{}", logStatus(lock)); }
+      return interrupted_ || ranges::all_of(this->flow_files_, [](const FlowFileResult& flow_file) {
+        return flow_file.flow_file_error || ranges::all_of(flow_file.messages, [](const MessageResult& message) {
           return message.status != MessageStatus::InFlight;
         });
       });
@@ -126,10 +114,10 @@ class PublishKafka::Messages {
   template<typename Func>
   auto modifyResult(size_t index, Func fun) -> decltype(fun(flow_files_.at(index))) {
     std::unique_lock<std::mutex> lock(mutex_);
-    const auto notifier = gsl::finally([this]{ cv_.notify_all(); });
+    const auto notifier = gsl::finally([this] { cv_.notify_all(); });
     try {
       return fun(flow_files_.at(index));
-    } catch(const std::exception& ex) {
+    } catch (const std::exception& ex) {
       logger_->log_warn("Messages::modifyResult exception: {}", ex.what());
       throw;
     }
@@ -144,9 +132,7 @@ class PublishKafka::Messages {
   template<typename Func>
   auto iterateFlowFiles(Func fun) -> std::void_t<decltype(fun(size_t{0}, flow_files_.front()))> {
     std::lock_guard<std::mutex> lock(mutex_);
-    for (size_t index = 0U; index < flow_files_.size(); index++) {
-      fun(index, flow_files_[index]);
-    }
+    for (size_t index = 0U; index < flow_files_.size(); index++) { fun(index, flow_files_[index]); }
   }
 
   void interrupt() {
@@ -164,96 +150,97 @@ class PublishKafka::Messages {
 
 namespace {
 class ReadCallback {
- public:
-  struct rd_kafka_headers_deleter {
-    void operator()(rd_kafka_headers_t* ptr) const noexcept {
-      rd_kafka_headers_destroy(ptr);
-    }
-  };
-
-  using rd_kafka_headers_unique_ptr = std::unique_ptr<rd_kafka_headers_t, rd_kafka_headers_deleter>;
-
- private:
   void allocate_message_object(const size_t segment_num) const {
     messages_->modifyResult(flow_file_index_, [segment_num](FlowFileResult& flow_file) {
       // allocate message object to be filled in by the callback in produce()
-      if (flow_file.messages.size() < segment_num + 1) {
-        flow_file.messages.resize(segment_num + 1);
-      }
+      if (flow_file.messages.size() < segment_num + 1) { flow_file.messages.resize(segment_num + 1); }
       gsl_Ensures(flow_file.messages.size() > segment_num);
     });
   }
 
-  static rd_kafka_headers_unique_ptr make_headers(const core::FlowFile& flow_file, const std::optional<utils::Regex>& attribute_name_regex) {
-    const gsl::owner<rd_kafka_headers_t*> result{ rd_kafka_headers_new(8) };
+  static utils::rd_kafka_headers_unique_ptr make_headers(const core::FlowFile& flow_file,
+      const std::optional<utils::Regex>& attribute_name_regex) {
+    utils::rd_kafka_headers_unique_ptr result{rd_kafka_headers_new(8)};
     if (!result) { throw std::bad_alloc{}; }
 
-    for (const auto& kv : flow_file.getAttributes()) {
-      if (attribute_name_regex && utils::regexMatch(kv.first, *attribute_name_regex)) {
-        rd_kafka_header_add(result, kv.first.c_str(), gsl::narrow<ssize_t>(kv.first.size()), kv.second.c_str(), gsl::narrow<ssize_t>(kv.second.size()));
+    for (const auto& [attribute_key, attribute_value]: flow_file.getAttributes()) {
+      if (attribute_name_regex && utils::regexMatch(attribute_key, *attribute_name_regex)) {
+        rd_kafka_header_add(result.get(),
+            attribute_key.c_str(),
+            gsl::narrow<ssize_t>(attribute_key.size()),
+            attribute_value.c_str(),
+            gsl::narrow<ssize_t>(attribute_value.size()));
       }
     }
-    return rd_kafka_headers_unique_ptr{ result };
+    return result;
   }
 
   rd_kafka_resp_err_t produce(const size_t segment_num, std::vector<std::byte>& buffer, const size_t buflen) const {
     const std::shared_ptr<PublishKafka::Messages> messages_ptr_copy = this->messages_;
     const auto flow_file_index_copy = this->flow_file_index_;
     const auto logger = logger_;
-    const auto produce_callback = [messages_ptr_copy, flow_file_index_copy, segment_num, logger](rd_kafka_t * /*rk*/, const rd_kafka_message_t *rkmessage) {
-      messages_ptr_copy->modifyResult(flow_file_index_copy, [segment_num, rkmessage, logger, flow_file_index_copy](FlowFileResult &flow_file) {
-        auto &message = flow_file.messages.at(segment_num);
-        message.err_code = rkmessage->err;
-        message.status = message.err_code == 0 ? MessageStatus::Success : MessageStatus::Error;
-        if (message.err_code != RD_KAFKA_RESP_ERR_NO_ERROR) {
-          logger->log_warn("delivery callback, flow file #{}/segment #{}: {}", flow_file_index_copy, segment_num, rd_kafka_err2str(message.err_code));
-        } else {
-          logger->log_debug("delivery callback, flow file #{}/segment #{}: success", flow_file_index_copy, segment_num);
-        }
-      });
+    const auto produce_callback = [messages_ptr_copy, flow_file_index_copy, segment_num, logger](rd_kafka_t* /*rk*/,
+                                      const rd_kafka_message_t* rkmessage) {
+      messages_ptr_copy->modifyResult(flow_file_index_copy,
+          [segment_num, rkmessage, logger, flow_file_index_copy](FlowFileResult& flow_file) {
+            auto& [status, err_code] = flow_file.messages.at(segment_num);
+            err_code = rkmessage->err;
+            status = err_code == 0 ? MessageStatus::Success : MessageStatus::Error;
+            if (err_code != RD_KAFKA_RESP_ERR_NO_ERROR) {
+              logger->log_warn("delivery callback, flow file #{}/segment #{}: {}",
+                  flow_file_index_copy,
+                  segment_num,
+                  rd_kafka_err2str(err_code));
+            } else {
+              logger->log_debug("delivery callback, flow file #{}/segment #{}: success", flow_file_index_copy, segment_num);
+            }
+          });
     };
     // release()d below, deallocated in PublishKafka::messageDeliveryCallback
-    auto callback_ptr = std::make_unique<std::function<void(rd_kafka_t*, const rd_kafka_message_t*)>>(std::move(produce_callback));
+    auto callback_ptr =
+        std::make_unique<std::function<void(rd_kafka_t*, const rd_kafka_message_t*)>>(std::move(produce_callback));
 
     allocate_message_object(segment_num);
 
-    const auto hdrs_copy = gsl::owner<rd_kafka_headers_t*>(rd_kafka_headers_copy(hdrs.get()));
-    const auto err = rd_kafka_producev(rk_, RD_KAFKA_V_RKT(rkt_), RD_KAFKA_V_PARTITION(RD_KAFKA_PARTITION_UA), RD_KAFKA_V_MSGFLAGS(RD_KAFKA_MSG_F_COPY), RD_KAFKA_V_VALUE(buffer.data(), buflen),
-        RD_KAFKA_V_HEADERS(hdrs_copy), RD_KAFKA_V_KEY(key_.c_str(), key_.size()), RD_KAFKA_V_OPAQUE(callback_ptr.get()), RD_KAFKA_V_END);
+    auto hdrs_copy = utils::rd_kafka_headers_unique_ptr{rd_kafka_headers_copy(hdrs.get())};
+    const auto err = rd_kafka_producev(rk_,
+        RD_KAFKA_V_RKT(rkt_),
+        RD_KAFKA_V_PARTITION(RD_KAFKA_PARTITION_UA),
+        RD_KAFKA_V_MSGFLAGS(RD_KAFKA_MSG_F_COPY),
+        RD_KAFKA_V_VALUE(buffer.data(), buflen),
+        RD_KAFKA_V_HEADERS(hdrs_copy.get()),
+        RD_KAFKA_V_KEY(key_.c_str(), key_.size()),
+        RD_KAFKA_V_OPAQUE(callback_ptr.get()),
+        RD_KAFKA_V_END);
     if (err == RD_KAFKA_RESP_ERR_NO_ERROR) {
       // in case of failure, messageDeliveryCallback is not called and callback_ptr will delete the callback
       // in case of success, messageDeliveryCallback takes ownership of the callback, so we no longer need to delete it
-      (void)callback_ptr.release();
-    } else {
-      // in case of failure, rd_kafka_producev doesn't take ownership of the headers, so we need to delete them
-      rd_kafka_headers_destroy(hdrs_copy);
-    }
-    logger_->log_trace("produce enqueued flow file #{}/segment #{}: {}", flow_file_index_, segment_num, rd_kafka_err2str(err));
+      std::ignore = hdrs_copy.release();
+      // in case of success, rd_kafka_producev takes ownership of the headers, so we no longer need to delete it
+      std::ignore = callback_ptr.release();
+    }
+    logger_->log_trace("produce enqueued flow file #{}/segment #{}: {}",
+        flow_file_index_,
+        segment_num,
+        rd_kafka_err2str(err));
     return err;
   }
 
  public:
-  ReadCallback(const uint64_t max_seg_size,
-      std::string key,
-      rd_kafka_topic_t* const rkt,
-      rd_kafka_t* const rk,
-      const core::FlowFile& flowFile,
-      const std::optional<utils::Regex>& attributeNameRegex,
-      std::shared_ptr<PublishKafka::Messages> messages,
-      const size_t flow_file_index,
-      const bool fail_empty_flow_files,
+  ReadCallback(const uint64_t max_seg_size, std::string key, rd_kafka_topic_t* const rkt, rd_kafka_t* const rk,
+      const core::FlowFile& flowFile, const std::optional<utils::Regex>& attributeNameRegex,
+      std::shared_ptr<PublishKafka::Messages> messages, const size_t flow_file_index, const bool fail_empty_flow_files,
       std::shared_ptr<core::logging::Logger> logger)
       : flow_size_(flowFile.getSize()),
-      max_seg_size_(max_seg_size == 0 || flow_size_ < max_seg_size ? flow_size_ : max_seg_size),
-      key_(std::move(key)),
-      rkt_(rkt),
-      rk_(rk),
-      hdrs(make_headers(flowFile, attributeNameRegex)),
-      messages_(std::move(messages)),
-      flow_file_index_(flow_file_index),
-      fail_empty_flow_files_(fail_empty_flow_files),
-      logger_(std::move(logger))
-  { }
+        max_seg_size_(max_seg_size == 0 || flow_size_ < max_seg_size ? flow_size_ : max_seg_size),
+        key_(std::move(key)),
+        rkt_(rkt),
+        rk_(rk),
+        hdrs(make_headers(flowFile, attributeNameRegex)),
+        messages_(std::move(messages)),
+        flow_file_index_(flow_file_index),
+        fail_empty_flow_files_(fail_empty_flow_files),
+        logger_(std::move(logger)) {}
 
   ReadCallback(ReadCallback&&) = delete;
   ReadCallback(const ReadCallback&) = delete;
@@ -272,9 +259,8 @@ class ReadCallback {
     gsl_Expects(max_seg_size_ != 0 || (flow_size_ == 0 && "max_seg_size_ == 0 implies flow_size_ == 0"));
     // ^^ therefore checking max_seg_size_ == 0 handles both division by zero and flow_size_ == 0 cases
     const size_t reserved_msg_capacity = max_seg_size_ == 0 ? 1 : utils::intdiv_ceil(flow_size_, max_seg_size_);
-    messages_->modifyResult(flow_file_index_, [reserved_msg_capacity](FlowFileResult& flow_file) {
-      flow_file.messages.reserve(reserved_msg_capacity);
-    });
+    messages_->modifyResult(flow_file_index_,
+        [reserved_msg_capacity](FlowFileResult& flow_file) { flow_file.messages.reserve(reserved_msg_capacity); });
 
     // If the flow file is empty, we still want to send the message, unless the user wants to fail_empty_flow_files_
     if (flow_size_ == 0 && !fail_empty_flow_files_) {
@@ -295,12 +281,11 @@ class ReadCallback {
       }
       if (readRet == 0) { break; }
 
-      const auto err = produce(segment_num, buffer, readRet);
-      if (err) {
+      if (const auto err = produce(segment_num, buffer, readRet)) {
         messages_->modifyResult(flow_file_index_, [segment_num, err](FlowFileResult& flow_file) {
-          auto& message = flow_file.messages.at(segment_num);
-          message.status = MessageStatus::Error;
-          message.err_code = err;
+          auto& [status, err_code] = flow_file.messages.at(segment_num);
+          status = MessageStatus::Error;
+          err_code = err;
         });
         status_ = -1;
         error_ = rd_kafka_err2str(err);
@@ -316,7 +301,7 @@ class ReadCallback {
   const std::string key_;
   rd_kafka_topic_t* const rkt_ = nullptr;
   rd_kafka_t* const rk_ = nullptr;
-  const rd_kafka_headers_unique_ptr hdrs;  // not null
+  const gsl::not_null<utils::rd_kafka_headers_unique_ptr> hdrs;
   const std::shared_ptr<PublishKafka::Messages> messages_;
   const size_t flow_file_index_;
   int status_ = 0;
@@ -331,14 +316,12 @@ class ReadCallback {
  * Message delivery report callback using the richer rd_kafka_message_t object.
  */
 void messageDeliveryCallback(rd_kafka_t* rk, const rd_kafka_message_t* rkmessage, void* /*opaque*/) {
-  if (rkmessage->_private == nullptr) {
-    return;
-  }
+  if (rkmessage->_private == nullptr) { return; }
   // allocated in ReadCallback::produce
-  auto* const func = reinterpret_cast<std::function<void(rd_kafka_t*, const rd_kafka_message_t*)>*>(rkmessage->_private);
+  const auto* const func = static_cast<std::function<void(rd_kafka_t*, const rd_kafka_message_t*)>*>(rkmessage->_private);
   try {
     (*func)(rk, rkmessage);
-  } catch (...) { }
+  } catch (...) {}
   delete func;  // NOLINT(cppcoreguidelines-owning-memory)
 }
 }  // namespace
@@ -376,10 +359,10 @@ void PublishKafka::onSchedule(core::ProcessContext& context, core::ProcessSessio
   logger_->log_debug("PublishKafka: Max Flow Segment Size [{}]", max_flow_seg_size_);
 
   // Attributes to Send as Headers
-  std::string value;
-  if (context.getProperty(AttributeNameRegex, value) && !value.empty()) {
-    attributeNameRegex_ = utils::Regex(value);
-    logger_->log_debug("PublishKafka: AttributeNameRegex [{}]", value);
+  if (const auto attribute_name_regex = context.getProperty(AttributeNameRegex);
+      attribute_name_regex && !attribute_name_regex->empty()) {
+    attributeNameRegex_ = utils::Regex(*attribute_name_regex);
+    logger_->log_debug("PublishKafka: AttributeNameRegex [{}]", *attribute_name_regex);
   }
 
   key_.brokers_ = brokers;
@@ -388,9 +371,12 @@ void PublishKafka::onSchedule(core::ProcessContext& context, core::ProcessSessio
   conn_ = std::make_unique<KafkaConnection>(key_);
   configureNewConnection(context);
 
-  std::string message_key_field;
-  if (context.getProperty(MessageKeyField, message_key_field) && !message_key_field.empty()) {
-    logger_->log_error("The {} property is set. This property is DEPRECATED and has no effect; please use Kafka Key instead.", MessageKeyField.name);
+  if (const auto message_key_field = context.getProperty(MessageKeyField);
+      message_key_field && !message_key_field->empty()) {
+    logger_->log_error(
+        "The {} property is set. This property is DEPRECATED and has no "
+        "effect; please use Kafka Key instead.",
+        MessageKeyField.name);
   }
 
   logger_->log_debug("Successfully configured PublishKafka");
@@ -400,149 +386,166 @@ void PublishKafka::notifyStop() {
   logger_->log_debug("notifyStop called");
   interrupted_ = true;
   {
-    // Normally when we need both connection_mutex_ and messages_mutex_, we need to take connection_mutex_ first to avoid a deadlock.
-    // It's not possible to do that here, because we need to interrupt the messages while onTrigger is running and holding connection_mutex_.
-    // For this reason, we take messages_mutex_ only, interrupt the messages, then release the lock to let a possibly running onTrigger take it and finish.
-    // After onTrigger finishes, we can take connection_mutex_ and close the connection without needing to wait for message finishes/timeouts in onTrigger.
-    // A possible new onTrigger between our critical sections won't produce more messages because we set interrupted_ = true above.
+    // Normally when we need both connection_mutex_ and messages_mutex_, we need to take connection_mutex_ first to avoid a
+    // deadlock. It's not possible to do that here, because we need to interrupt the messages while onTrigger is running and
+    // holding connection_mutex_. For this reason, we take messages_mutex_ only, interrupt the messages, then release the
+    // lock to let a possibly running onTrigger take it and finish. After onTrigger finishes, we can take connection_mutex_
+    // and close the connection without needing to wait for message finishes/timeouts in onTrigger. A possible new onTrigger
+    // between our critical sections won't produce more messages because we set interrupted_ = true above.
     std::lock_guard<std::mutex> lock(messages_mutex_);
-    for (auto& messages : messages_set_) {
-      messages->interrupt();
-    }
+    for (auto& messages: messages_set_) { messages->interrupt(); }
   }
   std::lock_guard<std::mutex> conn_lock(connection_mutex_);
   conn_.reset();
 }
 
-
 bool PublishKafka::configureNewConnection(core::ProcessContext& context) {
-  std::string value;
-  int64_t valInt = 0;
-  std::string valueConf;
-  std::array<char, 512U> errstr{};
+  std::array<char, 512U> err_chars{};
   rd_kafka_conf_res_t result = RD_KAFKA_CONF_OK;
-  const char* const PREFIX_ERROR_MSG = "PublishKafka: configure error result: ";
+  constexpr std::string_view PREFIX_ERROR_MSG = "PublishKafka: configure error result: ";
 
-  std::unique_ptr<rd_kafka_conf_t, rd_kafka_conf_deleter> conf_{ rd_kafka_conf_new() };
-  if (conf_ == nullptr) {
-    throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Failed to create rd_kafka_conf_t object");
-  }
+  utils::rd_kafka_conf_unique_ptr conf_{rd_kafka_conf_new()};
+  if (conf_ == nullptr) { throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Failed to create rd_kafka_conf_t object"); }
 
   const auto* const key = conn_->getKey();
 
-  if (key->brokers_.empty()) {
-    throw Exception(PROCESS_SCHEDULE_EXCEPTION, "There are no brokers");
-  }
-  result = rd_kafka_conf_set(conf_.get(), "bootstrap.servers", key->brokers_.c_str(), errstr.data(), errstr.size());
+  if (key->brokers_.empty()) { throw Exception(PROCESS_SCHEDULE_EXCEPTION, "There are no brokers"); }
+  result = rd_kafka_conf_set(conf_.get(), "bootstrap.servers", key->brokers_.c_str(), err_chars.data(), err_chars.size());
   logger_->log_debug("PublishKafka: bootstrap.servers [{}]", key->brokers_);
   if (result != RD_KAFKA_CONF_OK) {
-    auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, errstr.data());
+    auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, err_chars.data());
     throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
   }
 
-  if (key->client_id_.empty()) {
-    throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Client id is empty");
-  }
-  result = rd_kafka_conf_set(conf_.get(), "client.id", key->client_id_.c_str(), errstr.data(), errstr.size());
+  if (key->client_id_.empty()) { throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Client id is empty"); }
+  result = rd_kafka_conf_set(conf_.get(), "client.id", key->client_id_.c_str(), err_chars.data(), err_chars.size());
   logger_->log_debug("PublishKafka: client.id [{}]", key->client_id_);
   if (result != RD_KAFKA_CONF_OK) {
-    auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, errstr.data());
+    auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, err_chars.data());
     throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
   }
 
-  value = "";
-  if (context.getProperty(DebugContexts, value) && !value.empty()) {
-    result = rd_kafka_conf_set(conf_.get(), "debug", value.c_str(), errstr.data(), errstr.size());
-    logger_->log_debug("PublishKafka: debug [{}]", value);
+  if (auto debug_contexts = context.getProperty(DebugContexts); debug_contexts && !debug_contexts->empty()) {
+    result = rd_kafka_conf_set(conf_.get(), "debug", debug_contexts->c_str(), err_chars.data(), err_chars.size());
+    logger_->log_debug("PublishKafka: debug [{}]", *debug_contexts);
     if (result != RD_KAFKA_CONF_OK) {
-      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, errstr.data());
+      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, err_chars.data());
       throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
     }
   }
 
-  value = "";
-  if (context.getProperty(MaxMessageSize, value) && !value.empty()) {
-    result = rd_kafka_conf_set(conf_.get(), "message.max.bytes", value.c_str(), errstr.data(), errstr.size());
-    logger_->log_debug("PublishKafka: message.max.bytes [{}]", value);
+  if (auto max_message_size = context.getProperty(MaxMessageSize); max_message_size && !max_message_size->empty()) {
+    result = rd_kafka_conf_set(conf_.get(),
+        "message.max.bytes",
+        max_message_size->c_str(),
+        err_chars.data(),
+        err_chars.size());
+    logger_->log_debug("PublishKafka: message.max.bytes [{}]", max_message_size);
     if (result != RD_KAFKA_CONF_OK) {
-      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, errstr.data());
+      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, err_chars.data());
       throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
     }
   }
-  value = "";
-  uint32_t int_val = 0;
-  if (context.getProperty(QueueBufferMaxMessage, int_val)) {
-    if (int_val < batch_size_) {
-      throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Invalid configuration: Batch Size cannot be larger than Queue Max Message");
+
+  if (auto queue_buffer_max_message = context.getProperty<uint32_t>(QueueBufferMaxMessage)) {
+    if (*queue_buffer_max_message < batch_size_) {
+      throw Exception(PROCESS_SCHEDULE_EXCEPTION,
+          "Invalid configuration: Batch Size cannot be larger than Queue Max "
+          "Message");
     }
 
-    value = std::to_string(int_val);
-    result = rd_kafka_conf_set(conf_.get(), "queue.buffering.max.messages", value.c_str(), errstr.data(), errstr.size());
-    logger_->log_debug("PublishKafka: queue.buffering.max.messages [{}]", value);
+    auto queue_buffer_max_message_str = std::to_string(*queue_buffer_max_message);
+    result = rd_kafka_conf_set(conf_.get(),
+        "queue.buffering.max.messages",
+        queue_buffer_max_message_str.c_str(),
+        err_chars.data(),
+        err_chars.size());
+    logger_->log_debug("PublishKafka: queue.buffering.max.messages [{}]", queue_buffer_max_message_str);
     if (result != RD_KAFKA_CONF_OK) {
-      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, errstr.data());
+      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, err_chars.data());
       throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
     }
   }
-  value = "";
-  if (context.getProperty(QueueBufferMaxSize, value) && !value.empty() && core::Property::StringToInt(value, valInt)) {
-    valInt = valInt / 1024;
-    valueConf = std::to_string(valInt);
-    result = rd_kafka_conf_set(conf_.get(), "queue.buffering.max.kbytes", valueConf.c_str(), errstr.data(), errstr.size());
-    logger_->log_debug("PublishKafka: queue.buffering.max.kbytes [{}]", valueConf);
+
+  if (auto queue_buffer_max_size = context.getProperty<core::DataSizeValue>(QueueBufferMaxSize)) {
+    auto queue_buffer_max_size_kb = queue_buffer_max_size->getValue() / 1024;
+    auto queue_buffer_max_size_kb_str = std::to_string(queue_buffer_max_size_kb);
+    result = rd_kafka_conf_set(conf_.get(),
+        "queue.buffering.max.kbytes",
+        queue_buffer_max_size_kb_str.c_str(),
+        err_chars.data(),
+        err_chars.size());
+    logger_->log_debug("PublishKafka: queue.buffering.max.kbytes [{}]", queue_buffer_max_size_kb_str);
     if (result != RD_KAFKA_CONF_OK) {
-      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, errstr.data());
+      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, err_chars.data());
       throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
     }
   }
 
   if (auto queue_buffer_max_time = context.getProperty<core::TimePeriodValue>(QueueBufferMaxTime)) {
-    valueConf = std::to_string(queue_buffer_max_time->getMilliseconds().count());
-    result = rd_kafka_conf_set(conf_.get(), "queue.buffering.max.ms", valueConf.c_str(), errstr.data(), errstr.size());
-    logger_->log_debug("PublishKafka: queue.buffering.max.ms [{}]", valueConf);
+    auto queue_buffer_max_time_ms_str = std::to_string(queue_buffer_max_time->getMilliseconds().count());
+    result = rd_kafka_conf_set(conf_.get(),
+        "queue.buffering.max.ms",
+        queue_buffer_max_time_ms_str.c_str(),
+        err_chars.data(),
+        err_chars.size());
+    logger_->log_debug("PublishKafka: queue.buffering.max.ms [{}]", queue_buffer_max_time_ms_str);
     if (result != RD_KAFKA_CONF_OK) {
-      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, errstr.data());
+      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, err_chars.data());
       throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
     }
   }
-  value = "";
-  if (context.getProperty(BatchSize, value) && !value.empty()) {
-    result = rd_kafka_conf_set(conf_.get(), "batch.num.messages", value.c_str(), errstr.data(), errstr.size());
-    logger_->log_debug("PublishKafka: batch.num.messages [{}]", value);
+
+  if (auto batch_size = context.getProperty(BatchSize); batch_size && !batch_size->empty()) {
+    result = rd_kafka_conf_set(conf_.get(), "batch.num.messages", batch_size->c_str(), err_chars.data(), err_chars.size());
+    logger_->log_debug("PublishKafka: batch.num.messages [{}]", *batch_size);
     if (result != RD_KAFKA_CONF_OK) {
-      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, errstr.data());
+      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, err_chars.data());
       throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
     }
   }
-  value = "";
-  if (context.getProperty(CompressCodec, value) && !value.empty() && value != "none") {
-    result = rd_kafka_conf_set(conf_.get(), "compression.codec", value.c_str(), errstr.data(), errstr.size());
-    logger_->log_debug("PublishKafka: compression.codec [{}]", value);
+
+  if (auto compress_codec = utils::parseOptionalEnumProperty<CompressionCodecEnum>(context, CompressCodec)) {
+    auto compress_codec_str = magic_enum::enum_name(*compress_codec);
+    result = rd_kafka_conf_set(conf_.get(),
+        "compression.codec",
+        compress_codec_str.data(),
+        err_chars.data(),
+        err_chars.size());
+    logger_->log_debug("PublishKafka: compression.codec [{}]", compress_codec_str);
     if (result != RD_KAFKA_CONF_OK) {
-      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, errstr.data());
+      auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, err_chars.data());
       throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
     }
   }
 
   setKafkaAuthenticationParameters(context, gsl::make_not_null(conf_.get()));
 
-  // Add all of the dynamic properties as librdkafka configurations
-  const auto &dynamic_prop_keys = context.getDynamicPropertyKeys();
+  // Add all the dynamic properties as librdkafka configurations
+  const auto& dynamic_prop_keys = context.getDynamicPropertyKeys();
   logger_->log_info("PublishKafka registering {} librdkafka dynamic properties", dynamic_prop_keys.size());
 
-  for (const auto &prop_key : dynamic_prop_keys) {
+  for (const auto& prop_key: dynamic_prop_keys) {
     core::Property dynamic_property_key{prop_key, "dynamic property"};
     dynamic_property_key.setSupportsExpressionLanguage(true);
     std::string dynamic_property_value;
-    if (context.getDynamicProperty(dynamic_property_key, dynamic_property_value, nullptr) && !dynamic_property_value.empty()) {
+    if (context.getDynamicProperty(dynamic_property_key, dynamic_property_value, nullptr) &&
+        !dynamic_property_value.empty()) {
       logger_->log_debug("PublishKafka: DynamicProperty: [{}] -> [{}]", prop_key, dynamic_property_value);
-      result = rd_kafka_conf_set(conf_.get(), prop_key.c_str(), dynamic_property_value.c_str(), errstr.data(), errstr.size());
+      result = rd_kafka_conf_set(conf_.get(),
+          prop_key.c_str(),
+          dynamic_property_value.c_str(),
+          err_chars.data(),
+          err_chars.size());
       if (result != RD_KAFKA_CONF_OK) {
-        auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, errstr.data());
+        auto error_msg = utils::string::join_pack(PREFIX_ERROR_MSG, err_chars.data());
         throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
       }
     } else {
-      logger_->log_warn("PublishKafka Dynamic Property '{}' is empty and therefore will not be configured", prop_key);
+      logger_->log_warn(
+          "PublishKafka Dynamic Property '{}' is empty and therefore will not "
+          "be configured",
+          prop_key);
     }
   }
 
@@ -553,19 +556,21 @@ bool PublishKafka::configureNewConnection(core::ProcessContext& context) {
   rd_kafka_conf_set_log_cb(conf_.get(), &KafkaConnection::logCallback);
 
   // The producer takes ownership of the configuration, we must not free it
-  const auto producer = gsl::owner<rd_kafka_t*>(rd_kafka_new(RD_KAFKA_PRODUCER, conf_.release(), errstr.data(), errstr.size()));
+  utils::rd_kafka_producer_unique_ptr producer{
+      rd_kafka_new(RD_KAFKA_PRODUCER, conf_.release(), err_chars.data(), err_chars.size())};
   if (producer == nullptr) {
-    auto error_msg = utils::string::join_pack("Failed to create Kafka producer ", errstr.data());
+    auto error_msg = utils::string::join_pack("Failed to create Kafka producer ", err_chars.data());
     throw Exception(PROCESS_SCHEDULE_EXCEPTION, error_msg);
   }
 
-  conn_->setConnection(producer);
+  conn_->setConnection(std::move(producer));
 
   return true;
 }
 
-bool PublishKafka::createNewTopic(core::ProcessContext& context, const std::string& topic_name, const std::shared_ptr<core::FlowFile>& flow_file) {
-  std::unique_ptr<rd_kafka_topic_conf_t, rd_kafka_topic_conf_deleter> topic_conf_{ rd_kafka_topic_conf_new() };
+bool PublishKafka::createNewTopic(core::ProcessContext& context, const std::string& topic_name,
+    const std::shared_ptr<core::FlowFile>& flow_file) const {
+  utils::rd_kafka_topic_conf_unique_ptr topic_conf_{rd_kafka_topic_conf_new()};
   if (topic_conf_ == nullptr) {
     logger_->log_error("Failed to create rd_kafka_topic_conf_t object");
     return false;
@@ -573,7 +578,7 @@ bool PublishKafka::createNewTopic(core::ProcessContext& context, const std::stri
 
   rd_kafka_conf_res_t result = RD_KAFKA_CONF_OK;
   std::string value;
-  std::array<char, 512U> errstr{};
+  std::array<char, 512U> err_chars{};
   std::string valueConf;
 
   value = "";
@@ -581,7 +586,7 @@ bool PublishKafka::createNewTopic(core::ProcessContext& context, const std::stri
     /*
      * Because of a previous error in this processor, the default value of this property was "DELIVERY_ONE_NODE".
      * As this is not a valid value for "request.required.acks", the following rd_kafka_topic_conf_set call failed,
-     * but because of an another error, this failure was silently ignored, meaning that the the default value for
+     * but because of another error, this failure was silently ignored, meaning that the default value for
      * "request.required.acks" did not change, and thus remained "-1". This means that having "DELIVERY_ONE_NODE" as
      * the value of this property actually caused the processor to wait for delivery ACKs from ALL nodes, instead
      * of just one. In order not to break configurations generated with earlier versions and keep the same behaviour
@@ -589,66 +594,80 @@ bool PublishKafka::createNewTopic(core::ProcessContext& context, const std::stri
      */
     if (value == "DELIVERY_ONE_NODE") {
       value = "-1";
-      logger_->log_warn("Using DELIVERY_ONE_NODE as the Delivery Guarantee property is deprecated and is translated to -1 "
-                        "(block until message is committed by all in sync replicas) for backwards compatibility. "
-                        "If you want to wait for one acknowledgment use '1' as the property.");
-    }
-    result = rd_kafka_topic_conf_set(topic_conf_.get(), "request.required.acks", value.c_str(), errstr.data(), errstr.size());
+      logger_->log_warn(
+          "Using DELIVERY_ONE_NODE as the Delivery Guarantee property is "
+          "deprecated and is translated to -1 "
+          "(block until message is committed by all in sync replicas) for "
+          "backwards compatibility. "
+          "If you want to wait for one acknowledgment use '1' as the "
+          "property.");
+    }
+    result = rd_kafka_topic_conf_set(topic_conf_.get(),
+        "request.required.acks",
+        value.c_str(),
+        err_chars.data(),
+        err_chars.size());
     logger_->log_debug("PublishKafka: request.required.acks [{}]", value);
     if (result != RD_KAFKA_CONF_OK) {
-      logger_->log_error("PublishKafka: configure request.required.acks error result [{}]", errstr.data());
+      logger_->log_error("PublishKafka: configure request.required.acks error result [{}]", err_chars.data());
       return false;
     }
   }
 
-  if (auto request_timeout = context.getProperty<core::TimePeriodValue>(RequestTimeOut)) {
+  if (const auto request_timeout = context.getProperty<core::TimePeriodValue>(RequestTimeOut)) {
     valueConf = std::to_string(request_timeout->getMilliseconds().count());
-    result = rd_kafka_topic_conf_set(topic_conf_.get(), "request.timeout.ms", valueConf.c_str(), errstr.data(), errstr.size());
+    result = rd_kafka_topic_conf_set(topic_conf_.get(),
+        "request.timeout.ms",
+        valueConf.c_str(),
+        err_chars.data(),
+        err_chars.size());
     logger_->log_debug("PublishKafka: request.timeout.ms [{}]", valueConf);
     if (result != RD_KAFKA_CONF_OK) {
-      logger_->log_error("PublishKafka: configure request.timeout.ms error result [{}]", errstr.data());
+      logger_->log_error("PublishKafka: configure request.timeout.ms error result [{}]", err_chars.data());
       return false;
     }
   }
 
-  if (auto message_timeout = context.getProperty<core::TimePeriodValue>(MessageTimeOut)) {
+  if (const auto message_timeout = context.getProperty<core::TimePeriodValue>(MessageTimeOut)) {
     valueConf = std::to_string(message_timeout->getMilliseconds().count());
-    result = rd_kafka_topic_conf_set(topic_conf_.get(), "message.timeout.ms", valueConf.c_str(), errstr.data(), errstr.size());
+    result = rd_kafka_topic_conf_set(topic_conf_.get(),
+        "message.timeout.ms",
+        valueConf.c_str(),
+        err_chars.data(),
+        err_chars.size());
     logger_->log_debug("PublishKafka: message.timeout.ms [{}]", valueConf);
     if (result != RD_KAFKA_CONF_OK) {
-      logger_->log_error("PublishKafka: configure message.timeout.ms error result [{}]", errstr.data());
+      logger_->log_error("PublishKafka: configure message.timeout.ms error result [{}]", err_chars.data());
       return false;
     }
   }
 
   // The topic takes ownership of the configuration, we must not free it
-  const auto topic_reference = gsl::owner<rd_kafka_topic_t*>(rd_kafka_topic_new(conn_->getConnection(), topic_name.c_str(), topic_conf_.release()));
+  utils::rd_kafka_topic_unique_ptr topic_reference{
+      rd_kafka_topic_new(conn_->getConnection(), topic_name.c_str(), topic_conf_.release())};
   if (topic_reference == nullptr) {
-    rd_kafka_resp_err_t resp_err = rd_kafka_last_error();
+    const rd_kafka_resp_err_t resp_err = rd_kafka_last_error();
     logger_->log_error("PublishKafka: failed to create topic {}, error: {}", topic_name.c_str(), rd_kafka_err2str(resp_err));
     return false;
   }
 
-  const auto kafkaTopicref = std::make_shared<KafkaTopic>(topic_reference);  // KafkaTopic takes ownership of topic_reference
-  conn_->putTopic(topic_name, kafkaTopicref);
+  const auto kafka_topic_ref =
+      std::make_shared<KafkaTopic>(std::move(topic_reference));  // KafkaTopic takes ownership of topic_reference
+  conn_->putTopic(topic_name, kafka_topic_ref);
 
   return true;
 }
 
 std::optional<utils::net::SslData> PublishKafka::getSslData(core::ProcessContext& context) const {
-  if (auto result = KafkaProcessorBase::getSslData(context); result) {
-    return result;
-  }
+  if (auto result = KafkaProcessorBase::getSslData(context); result) { return result; }
 
   utils::net::SslData ssl_data;
-  if (auto security_ca = context.getProperty(SecurityCA))
-    ssl_data.ca_loc = *security_ca;
-  if (auto security_cert = context.getProperty(SecurityCert))
-    ssl_data.cert_loc = *security_cert;
-  if (auto security_private_key = context.getProperty(SecurityPrivateKey))
-    ssl_data.key_loc = *security_private_key;
-  if (auto security_private_key_pass = context.getProperty(SecurityPrivateKeyPassWord))
+  if (auto security_ca = context.getProperty(SecurityCA)) { ssl_data.ca_loc = *security_ca; }
+  if (auto security_cert = context.getProperty(SecurityCert)) { ssl_data.cert_loc = *security_cert; }
+  if (auto security_private_key = context.getProperty(SecurityPrivateKey)) { ssl_data.key_loc = *security_private_key; }
+  if (auto security_private_key_pass = context.getProperty(SecurityPrivateKeyPassWord)) {
     ssl_data.key_pw = *security_private_key_pass;
+  }
   return ssl_data;
 }
 
@@ -668,14 +687,10 @@ void PublishKafka::onTrigger(core::ProcessContext& context, core::ProcessSession
   std::vector<std::shared_ptr<core::FlowFile>> flowFiles;
   for (uint32_t i = 0; i < batch_size_; i++) {
     std::shared_ptr<core::FlowFile> flowFile = session.get();
-    if (flowFile == nullptr) {
-      break;
-    }
+    if (flowFile == nullptr) { break; }
     actual_bytes += flowFile->getSize();
     flowFiles.emplace_back(std::move(flowFile));
-    if (target_batch_payload_size_ != 0U && actual_bytes >= target_batch_payload_size_) {
-      break;
-    }
+    if (target_batch_payload_size_ != 0U && actual_bytes >= target_batch_payload_size_) { break; }
   }
   if (flowFiles.empty()) {
     context.yield();
@@ -696,8 +711,8 @@ void PublishKafka::onTrigger(core::ProcessContext& context, core::ProcessSession
   });
 
   // Process FlowFiles
-  for (auto& flowFile : flowFiles) {
-    size_t flow_file_index = messages->addFlowFile();
+  for (auto& flowFile: flowFiles) {
+    const size_t flow_file_index = messages->addFlowFile();
 
     // Get Topic (FlowFile-dependent EL property)
     std::string topic;
@@ -705,9 +720,8 @@ void PublishKafka::onTrigger(core::ProcessContext& context, core::ProcessSession
       logger_->log_debug("PublishKafka: topic for flow file {} is '{}'", flowFile->getUUIDStr(), topic);
     } else {
       logger_->log_error("Flow file {} does not have a valid Topic", flowFile->getUUIDStr());
-      messages->modifyResult(flow_file_index, [](FlowFileResult& flow_file_result) {
-        flow_file_result.flow_file_error = true;
-      });
+      messages->modifyResult(flow_file_index,
+          [](FlowFileResult& flow_file_result) { flow_file_result.flow_file_error = true; });
       continue;
     }
 
@@ -715,33 +729,37 @@ void PublishKafka::onTrigger(core::ProcessContext& context, core::ProcessSession
     if (!conn_->hasTopic(topic)) {
       if (!createNewTopic(context, topic, flowFile)) {
         logger_->log_error("Failed to add topic {}", topic);
-        messages->modifyResult(flow_file_index, [](FlowFileResult& flow_file_result) {
-          flow_file_result.flow_file_error = true;
-        });
+        messages->modifyResult(flow_file_index,
+            [](FlowFileResult& flow_file_result) { flow_file_result.flow_file_error = true; });
         continue;
       }
     }
 
     std::string kafkaKey;
-    if (!context.getProperty(KafkaKey, kafkaKey, flowFile.get()) || kafkaKey.empty()) {
-      kafkaKey = flowFile->getUUIDStr();
-    }
+    if (!context.getProperty(KafkaKey, kafkaKey, flowFile.get()) || kafkaKey.empty()) { kafkaKey = flowFile->getUUIDStr(); }
     logger_->log_debug("PublishKafka: Message Key [{}]", kafkaKey);
 
     auto thisTopic = conn_->getTopic(topic);
     if (thisTopic == nullptr) {
       logger_->log_error("Topic {} is invalid", topic);
-      messages->modifyResult(flow_file_index, [](FlowFileResult& flow_file_result) {
-        flow_file_result.flow_file_error = true;
-      });
+      messages->modifyResult(flow_file_index,
+          [](FlowFileResult& flow_file_result) { flow_file_result.flow_file_error = true; });
       continue;
     }
 
     bool failEmptyFlowFiles = true;
     context.getProperty(FailEmptyFlowFiles, failEmptyFlowFiles);
 
-    ReadCallback callback(max_flow_seg_size_, kafkaKey, thisTopic->getTopic(), conn_->getConnection(), *flowFile,
-                          attributeNameRegex_, messages, flow_file_index, failEmptyFlowFiles, logger_);
+    ReadCallback callback(max_flow_seg_size_,
+        kafkaKey,
+        thisTopic->getTopic(),
+        conn_->getConnection(),
+        *flowFile,
+        attributeNameRegex_,
+        messages,
+        flow_file_index,
+        failEmptyFlowFiles,
+        logger_);
     session.read(flowFile, std::ref(callback));
 
     if (!callback.called_) {
@@ -750,17 +768,18 @@ void PublishKafka::onTrigger(core::ProcessContext& context, core::ProcessSession
     }
 
     if (flowFile->getSize() == 0 && failEmptyFlowFiles) {
-      logger_->log_debug("Deprecated behavior, use connections to drop empty flow files! Failing empty flow file with uuid: {}", flowFile->getUUIDStr());
-      messages->modifyResult(flow_file_index, [](FlowFileResult& flow_file_result) {
-        flow_file_result.flow_file_error = true;
-      });
+      logger_->log_debug(
+          "Deprecated behavior, use connections to drop empty flow files! "
+          "Failing empty flow file with uuid: {}",
+          flowFile->getUUIDStr());
+      messages->modifyResult(flow_file_index,
+          [](FlowFileResult& flow_file_result) { flow_file_result.flow_file_error = true; });
     }
 
     if (callback.status_ < 0) {
       logger_->log_error("Failed to send flow to kafka topic {}, error: {}", topic, callback.error_);
-      messages->modifyResult(flow_file_index, [](FlowFileResult& flow_file_result) {
-        flow_file_result.flow_file_error = true;
-      });
+      messages->modifyResult(flow_file_index,
+          [](FlowFileResult& flow_file_result) { flow_file_result.flow_file_error = true; });
       continue;
     }
   }
@@ -768,7 +787,10 @@ void PublishKafka::onTrigger(core::ProcessContext& context, core::ProcessSession
   logger_->log_trace("PublishKafka::onTrigger waitForCompletion start");
   messages->waitForCompletion();
   if (messages->wasInterrupted()) {
-    logger_->log_warn("Waiting for delivery confirmation was interrupted, some flow files might be routed to Failure, even if they were successfully delivered.");
+    logger_->log_warn(
+        "Waiting for delivery confirmation was interrupted, some flow files "
+        "might be routed to Failure, even if they were successfully "
+        "delivered.");
   }
   logger_->log_trace("PublishKafka::onTrigger waitForCompletion finish");
 
@@ -783,22 +805,24 @@ void PublishKafka::onTrigger(core::ProcessContext& context, core::ProcessSession
         switch (message.status) {
           case MessageStatus::InFlight:
             success = false;
-            logger_->log_error("Waiting for delivery confirmation was interrupted for flow file {} segment {}",
+            logger_->log_error(
+                "Waiting for delivery confirmation was interrupted for flow "
+                "file {} segment {}",
                 flowFiles[index]->getUUIDStr(),
                 segment_num);
-          break;
+            break;
           case MessageStatus::Error:
             success = false;
             logger_->log_error("Failed to deliver flow file {} segment {}, error: {}",
                 flowFiles[index]->getUUIDStr(),
                 segment_num,
                 rd_kafka_err2str(message.err_code));
-          break;
+            break;
           case MessageStatus::Success:
             logger_->log_debug("Successfully delivered flow file {} segment {}",
                 flowFiles[index]->getUUIDStr(),
                 segment_num);
-          break;
+            break;
         }
       }
     }
diff --git a/extensions/kafka/PublishKafka.h b/extensions/kafka/PublishKafka.h
new file mode 100644
index 000000000..1fd5e3408
--- /dev/null
+++ b/extensions/kafka/PublishKafka.h
@@ -0,0 +1,288 @@
+/**
+ * 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.
+ */
+#pragma once
+
+#include <atomic>
+#include <condition_variable>
+#include <cstdint>
+#include <map>
+#include <memory>
+#include <mutex>
+#include <set>
+#include <string>
+#include <utility>
+#include <vector>
+
+#include "KafkaConnection.h"
+#include "KafkaProcessorBase.h"
+#include "controllers/SSLContextService.h"
+#include "core/Core.h"
+#include "core/FlowFile.h"
+#include "core/ProcessSession.h"
+#include "core/PropertyDefinition.h"
+#include "core/PropertyDefinitionBuilder.h"
+#include "core/PropertyType.h"
+#include "core/RelationshipDefinition.h"
+#include "core/logging/Logger.h"
+#include "core/logging/LoggerConfiguration.h"
+#include "rdkafka.h"
+#include "utils/ArrayUtils.h"
+#include "utils/RegexUtils.h"
+
+namespace org::apache::nifi::minifi::processors {
+
+class PublishKafka final : public KafkaProcessorBase {
+ public:
+  enum class CompressionCodecEnum { none, gzip, snappy, lz4, zstd };
+
+  EXTENSIONAPI static constexpr const char* Description =
+      "This Processor puts the contents of a FlowFile to a Topic in Apache "
+      "Kafka. "
+      "The content of a FlowFile becomes the contents of a Kafka message. "
+      "This message is optionally assigned a key by using the <Kafka Key> "
+      "Property.";
+
+  EXTENSIONAPI static constexpr auto SeedBrokers =
+      core::PropertyDefinitionBuilder<>::createProperty("Known Brokers")
+          .withDescription(
+              "A comma-separated list of known Kafka Brokers in the format "
+              "<host>:<port>")
+          .isRequired(true)
+          .supportsExpressionLanguage(true)
+          .build();
+  EXTENSIONAPI static constexpr auto Topic =
+      core::PropertyDefinitionBuilder<>::createProperty("Topic Name")
+          .withDescription("The Kafka Topic of interest")
+          .isRequired(true)
+          .supportsExpressionLanguage(true)
+          .build();
+  EXTENSIONAPI static constexpr auto DeliveryGuarantee =
+      core::PropertyDefinitionBuilder<>::createProperty("Delivery Guarantee")
+          .withDescription(
+              "Specifies the requirement for guaranteeing that a message is "
+              "sent to Kafka. "
+              "Valid values are 0 (do not wait for acks), "
+              "-1 or all (block until message is committed by all in sync "
+              "replicas) "
+              "or any concrete number of nodes.")
+          .isRequired(false)
+          .supportsExpressionLanguage(true)
+          .withDefaultValue("1")
+          .build();
+  EXTENSIONAPI static constexpr auto MaxMessageSize =
+      core::PropertyDefinitionBuilder<>::createProperty("Max Request Size")
+          .withDescription("Maximum Kafka protocol request message size")
+          .isRequired(false)
+          .build();
+  EXTENSIONAPI static constexpr auto RequestTimeOut =
+      core::PropertyDefinitionBuilder<>::createProperty("Request Timeout")
+          .withDescription("The ack timeout of the producer request")
+          .isRequired(false)
+          .withPropertyType(core::StandardPropertyTypes::TIME_PERIOD_TYPE)
+          .withDefaultValue("10 sec")
+          .build();
+  EXTENSIONAPI static constexpr auto MessageTimeOut =
+      core::PropertyDefinitionBuilder<>::createProperty("Message Timeout")
+          .withDescription("The total time sending a message could take")
+          .isRequired(false)
+          .withPropertyType(core::StandardPropertyTypes::TIME_PERIOD_TYPE)
+          .withDefaultValue("30 sec")
+          .build();
+  EXTENSIONAPI static constexpr auto ClientName =
+      core::PropertyDefinitionBuilder<>::createProperty("Client Name")
+          .withDescription("Client Name to use when communicating with Kafka")
+          .isRequired(true)
+          .supportsExpressionLanguage(true)
+          .build();
+  EXTENSIONAPI static constexpr auto BatchSize =
+      core::PropertyDefinitionBuilder<>::createProperty("Batch Size")
+          .withDescription("Maximum number of messages batched in one MessageSet")
+          .isRequired(false)
+          .withPropertyType(core::StandardPropertyTypes::UNSIGNED_INT_TYPE)
+          .withDefaultValue("10")
+          .build();
+  EXTENSIONAPI static constexpr auto TargetBatchPayloadSize =
+      core::PropertyDefinitionBuilder<>::createProperty("Target Batch Payload Size")
+          .withDescription(
+              "The target total payload size for a batch. 0 B means unlimited "
+              "(Batch Size is still applied).")
+          .isRequired(false)
+          .withPropertyType(core::StandardPropertyTypes::DATA_SIZE_TYPE)
+          .withDefaultValue("512 KB")
+          .build();
+  EXTENSIONAPI static constexpr auto AttributeNameRegex =
+      core::PropertyDefinitionBuilder<>::createProperty("Attributes to Send as Headers")
+          .withDescription(
+              "Any attribute whose name matches the regex will be added to the "
+              "Kafka messages as a Header")
+          .build();
+  EXTENSIONAPI static constexpr auto QueueBufferMaxTime =
+      core::PropertyDefinitionBuilder<>::createProperty("Queue Buffering Max Time")
+          .withDescription(
+              "Delay to wait for messages in the producer queue to accumulate "
+              "before constructing message batches")
+          .isRequired(false)
+          .withPropertyType(core::StandardPropertyTypes::TIME_PERIOD_TYPE)
+          .withDefaultValue("5 millis")
+          .build();
+  EXTENSIONAPI static constexpr auto QueueBufferMaxSize =
+      core::PropertyDefinitionBuilder<>::createProperty("Queue Max Buffer Size")
+          .withDescription("Maximum total message size sum allowed on the producer queue")
+          .isRequired(false)
+          .withPropertyType(core::StandardPropertyTypes::DATA_SIZE_TYPE)
+          .withDefaultValue("1 MB")
+          .build();
+  EXTENSIONAPI static constexpr auto QueueBufferMaxMessage =
+      core::PropertyDefinitionBuilder<>::createProperty("Queue Max Message")
+          .withDescription("Maximum number of messages allowed on the producer queue")
+          .isRequired(false)
+          .withPropertyType(core::StandardPropertyTypes::UNSIGNED_LONG_TYPE)
+          .withDefaultValue("1000")
+          .build();
+  EXTENSIONAPI static constexpr auto CompressCodec =
+      core::PropertyDefinitionBuilder<magic_enum::enum_count<CompressionCodecEnum>()>::createProperty("Compress Codec")
+          .withDescription("compression codec to use for compressing message sets")
+          .isRequired(false)
+          .withDefaultValue(magic_enum::enum_name(CompressionCodecEnum::none))
+          .withAllowedValues(magic_enum::enum_names<CompressionCodecEnum>())
+          .build();
+  EXTENSIONAPI static constexpr auto MaxFlowSegSize =
+      core::PropertyDefinitionBuilder<>::createProperty("Max Flow Segment Size")
+          .withDescription(
+              "Maximum flow content payload segment size for the kafka record. "
+              "0 B means unlimited.")
+          .isRequired(false)
+          .withPropertyType(core::StandardPropertyTypes::DATA_SIZE_TYPE)
+          .withDefaultValue("0 B")
+          .build();
+  EXTENSIONAPI static constexpr auto SecurityCA =
+      core::PropertyDefinitionBuilder<>::createProperty("Security CA")
+          .withDescription(
+              "DEPRECATED in favor of SSL Context Service. File or directory "
+              "path to CA certificate(s) for verifying the broker's key")
+          .build();
+  EXTENSIONAPI static constexpr auto SecurityCert =
+      core::PropertyDefinitionBuilder<>::createProperty("Security Cert")
+          .withDescription(
+              "DEPRECATED in favor of SSL Context Service.Path to client's "
+              "public key (PEM) used for authentication")
+          .build();
+  EXTENSIONAPI static constexpr auto SecurityPrivateKey =
+      core::PropertyDefinitionBuilder<>::createProperty("Security Private Key")
+          .withDescription(
+              "DEPRECATED in favor of SSL Context Service.Path to client's "
+              "private key (PEM) used for authentication")
+          .build();
+  EXTENSIONAPI static constexpr auto SecurityPrivateKeyPassWord =
+      core::PropertyDefinitionBuilder<>::createProperty("Security Pass Phrase")
+          .withDescription(
+              "DEPRECATED in favor of SSL Context Service.Private key "
+              "passphrase")
+          .isSensitive(true)
+          .build();
+  EXTENSIONAPI static constexpr auto KafkaKey =
+      core::PropertyDefinitionBuilder<>::createProperty("Kafka Key")
+          .withDescription(
+              "The key to use for the message. If not specified, the UUID of "
+              "the flow file is used as the message key.")
+          .supportsExpressionLanguage(true)
+          .build();
+  EXTENSIONAPI static constexpr auto MessageKeyField =
+      core::PropertyDefinitionBuilder<>::createProperty("Message Key Field")
+          .withDescription("DEPRECATED, does not work -- use Kafka Key instead")
+          .build();
+  EXTENSIONAPI static constexpr auto DebugContexts =
+      core::PropertyDefinitionBuilder<>::createProperty("Debug contexts")
+          .withDescription(
+              "A comma-separated list of debug contexts to enable."
+              "Including: generic, broker, topic, metadata, feature, queue, "
+              "msg, protocol, cgrp, security, fetch, interceptor, plugin, "
+              "consumer, "
+              "admin, eos, all")
+          .build();
+  EXTENSIONAPI static constexpr auto FailEmptyFlowFiles =
+      core::PropertyDefinitionBuilder<>::createProperty("Fail empty flow files")
+          .withDescription(
+              "Keep backwards compatibility with <=0.7.0 bug which caused flow "
+              "files with empty content to not be published to Kafka and "
+              "forwarded "
+              "to failure. The old behavior is "
+              "deprecated. Use connections to drop empty flow files!")
+          .isRequired(false)
+          .withPropertyType(core::StandardPropertyTypes::BOOLEAN_TYPE)
+          .withDefaultValue("true")
+          .build();
+  EXTENSIONAPI static constexpr auto Properties = utils::array_cat(KafkaProcessorBase::Properties,
+      std::to_array<core::PropertyReference>({SeedBrokers, Topic, DeliveryGuarantee, MaxMessageSize, RequestTimeOut,
+          MessageTimeOut, ClientName, BatchSize, TargetBatchPayloadSize, AttributeNameRegex, QueueBufferMaxTime,
+          QueueBufferMaxSize, QueueBufferMaxMessage, CompressCodec, MaxFlowSegSize, SecurityCA, SecurityCert,
+          SecurityPrivateKey, SecurityPrivateKeyPassWord, KafkaKey, MessageKeyField, DebugContexts, FailEmptyFlowFiles}));
+
+  EXTENSIONAPI static constexpr auto Success = core::RelationshipDefinition{"success",
+      "Any FlowFile that is successfully sent to Kafka will be routed to "
+      "this Relationship"};
+  EXTENSIONAPI static constexpr auto Failure = core::RelationshipDefinition{"failure",
+      "Any FlowFile that cannot be sent to Kafka will be routed to this "
+      "Relationship"};
+  EXTENSIONAPI static constexpr auto Relationships = std::array{Success, Failure};
+
+  EXTENSIONAPI static constexpr bool SupportsDynamicProperties = true;
+  EXTENSIONAPI static constexpr bool SupportsDynamicRelationships = false;
+  EXTENSIONAPI static constexpr auto InputRequirement = core::annotation::Input::INPUT_REQUIRED;
+  EXTENSIONAPI static constexpr bool IsSingleThreaded = false;
+
+  ADD_COMMON_VIRTUAL_FUNCTIONS_FOR_PROCESSORS
+
+  explicit PublishKafka(const std::string_view name, const utils::Identifier& uuid = {})
+      : KafkaProcessorBase(name, uuid, core::logging::LoggerFactory<PublishKafka>::getLogger(uuid)) {}
+
+  PublishKafka(const PublishKafka&) = delete;
+  PublishKafka(PublishKafka&&) = delete;
+  PublishKafka& operator=(const PublishKafka&) = delete;
+  PublishKafka& operator=(PublishKafka&&) = delete;
+  ~PublishKafka() override = default;
+
+  void onTrigger(core::ProcessContext& context, core::ProcessSession& session) override;
+  void initialize() override;
+  void onSchedule(core::ProcessContext& context, core::ProcessSessionFactory& sessionFactory) override;
+  void notifyStop() override;
+
+  class Messages;
+
+ protected:
+  bool configureNewConnection(core::ProcessContext& context);
+  bool createNewTopic(
+      core::ProcessContext& context, const std::string& topic_name, const std::shared_ptr<core::FlowFile>& flow_file) const;
+  std::optional<utils::net::SslData> getSslData(core::ProcessContext& context) const override;
+
+ private:
+  KafkaConnectionKey key_;
+  std::unique_ptr<KafkaConnection> conn_;
+  std::mutex connection_mutex_;
+
+  uint32_t batch_size_{};
+  uint64_t target_batch_payload_size_{};
+  uint64_t max_flow_seg_size_{};
+  std::optional<utils::Regex> attributeNameRegex_;
+
+  std::atomic<bool> interrupted_{false};
+  std::mutex messages_mutex_;  // If both connection_mutex_ and messages_mutex_ are needed, always take connection_mutex_
+                               // first to avoid deadlock
+  std::set<std::shared_ptr<Messages>> messages_set_;
+};
+
+}  // namespace org::apache::nifi::minifi::processors
diff --git a/extensions/librdkafka/rdkafka_utils.cpp b/extensions/kafka/rdkafka_utils.cpp
similarity index 73%
rename from extensions/librdkafka/rdkafka_utils.cpp
rename to extensions/kafka/rdkafka_utils.cpp
index 3d57a9c0d..6482d5c52 100644
--- a/extensions/librdkafka/rdkafka_utils.cpp
+++ b/extensions/kafka/rdkafka_utils.cpp
@@ -15,10 +15,10 @@
  * limitations under the License.
  */
 
-#include <array>
-
 #include "rdkafka_utils.h"
 
+#include <array>
+
 #include "Exception.h"
 #include "utils/StringUtils.h"
 
@@ -29,22 +29,22 @@ void setKafkaConfigurationField(rd_kafka_conf_t& configuration, const std::strin
   rd_kafka_conf_res_t result{};
   result = rd_kafka_conf_set(&configuration, field_name.c_str(), value.c_str(), errstr.data(), errstr.size());
   if (RD_KAFKA_CONF_OK != result) {
-    const std::string error_msg { errstr.data() };
+    const std::string error_msg{errstr.data()};
     throw Exception(PROCESS_SCHEDULE_EXCEPTION, "rd_kafka configuration error: " + error_msg);
   }
 }
 
-void print_topics_list(core::logging::Logger& logger, rd_kafka_topic_partition_list_t& kf_topic_partition_list) {
+void print_topics_list(core::logging::Logger& logger, const rd_kafka_topic_partition_list_t& kf_topic_partition_list) {
   for (int i = 0; i < kf_topic_partition_list.cnt; ++i) {
-    logger.log_debug("kf_topic_partition_list: topic: {}, partition: {}, offset: {}.",
-    kf_topic_partition_list.elems[i].topic, kf_topic_partition_list.elems[i].partition, kf_topic_partition_list.elems[i].offset);
+    logger.log_debug("kf_topic_partition_list: topic: {}, partition: {}, offset: {}.", kf_topic_partition_list.elems[i].topic,
+        kf_topic_partition_list.elems[i].partition, kf_topic_partition_list.elems[i].offset);
   }
 }
 
 std::string get_human_readable_kafka_message_timestamp(const rd_kafka_message_t& rkmessage) {
   rd_kafka_timestamp_type_t tstype{};
   int64_t timestamp = rd_kafka_message_timestamp(&rkmessage, &tstype);
-  const char *tsname = "?";
+  const char* tsname = "?";
   if (tstype == RD_KAFKA_TIMESTAMP_CREATE_TIME) {
     tsname = "create time";
   } else if (tstype == RD_KAFKA_TIMESTAMP_LOG_APPEND_TIME) {
@@ -59,30 +59,32 @@ std::string get_human_readable_kafka_message_headers(const rd_kafka_message_t& r
   const rd_kafka_resp_err_t get_header_response = rd_kafka_message_headers(&rkmessage, &hdrs);
   if (RD_KAFKA_RESP_ERR_NO_ERROR == get_header_response) {
     std::vector<std::string> header_list;
-    kafka_headers_for_each(*hdrs, [&] (const std::string& key, std::span<const char> val) { header_list.emplace_back(key + ": " + std::string{ val.data(), val.size() }); });
+    kafka_headers_for_each(*hdrs, [&](const std::string& key, std::span<const char> val) {
+      header_list.emplace_back(key + ": " + std::string{val.data(), val.size()});
+    });
     return string::join(", ", header_list);
   }
-  if (RD_KAFKA_RESP_ERR__NOENT == get_header_response) {
-    return "[None]";
-  }
-  logger.log_error("Failed to fetch message headers: {}: {}", magic_enum::enum_underlying(rd_kafka_last_error()), rd_kafka_err2str(rd_kafka_last_error()));
+  if (RD_KAFKA_RESP_ERR__NOENT == get_header_response) { return "[None]"; }
+  logger.log_error(
+      "Failed to fetch message headers: {}: {}", magic_enum::enum_underlying(rd_kafka_last_error()), rd_kafka_err2str(rd_kafka_last_error()));
   return "[Error]";
 }
 
 void print_kafka_message(const rd_kafka_message_t& rkmessage, core::logging::Logger& logger) {
   if (RD_KAFKA_RESP_ERR_NO_ERROR != rkmessage.err) {
-    const std::string error_msg = "ConsumeKafka: received error message from broker. Librdkafka error msg: " + std::string(rd_kafka_err2str(rkmessage.err));
+    const std::string error_msg =
+        "ConsumeKafka: received error message from broker. Librdkafka error msg: " + std::string(rd_kafka_err2str(rkmessage.err));
     throw minifi::Exception(ExceptionType::PROCESSOR_EXCEPTION, error_msg);
   }
   std::string topicName = rd_kafka_topic_name(rkmessage.rkt);
-  std::string message(reinterpret_cast<char*>(rkmessage.payload), rkmessage.len);
-  const char* key = reinterpret_cast<const char*>(rkmessage.key);
+  std::string message(static_cast<char*>(rkmessage.payload), rkmessage.len);
+  const char* key = static_cast<const char*>(rkmessage.key);
   const std::size_t key_len = rkmessage.key_len;
 
   std::string message_as_string;
   message_as_string += "[Topic](" + topicName + "), ";
   message_as_string += "[Key](" + (key != nullptr ? std::string(key, key_len) : std::string("[None]")) + "), ";
-  message_as_string += "[Offset](" +  std::to_string(rkmessage.offset) + "), ";
+  message_as_string += "[Offset](" + std::to_string(rkmessage.offset) + "), ";
   message_as_string += "[Message Length](" + std::to_string(rkmessage.len) + "), ";
   message_as_string += get_human_readable_kafka_message_timestamp(rkmessage) + "), ";
   message_as_string += "[Headers](";
@@ -94,19 +96,15 @@ void print_kafka_message(const rd_kafka_message_t& rkmessage, core::logging::Log
 
 std::string get_encoded_string(const std::string& input, KafkaEncoding encoding) {
   switch (encoding) {
-    case KafkaEncoding::UTF8:
-      return input;
-    case KafkaEncoding::HEX:
-      return string::to_hex(input, /* uppercase = */ true);
+    case KafkaEncoding::UTF8: return input;
+    case KafkaEncoding::HEX: return string::to_hex(input, /* uppercase = */ true);
   }
   throw std::runtime_error("Invalid encoding selected: " + input);
 }
 
 std::optional<std::string> get_encoded_message_key(const rd_kafka_message_t& message, KafkaEncoding encoding) {
-  if (nullptr == message.key) {
-    return {};
-  }
-  return get_encoded_string({reinterpret_cast<const char*>(message.key), message.key_len}, encoding);
+  if (nullptr == message.key) { return {}; }
+  return get_encoded_string({static_cast<const char*>(message.key), message.key_len}, encoding);
 }
 
 }  // namespace org::apache::nifi::minifi::utils
diff --git a/extensions/librdkafka/rdkafka_utils.h b/extensions/kafka/rdkafka_utils.h
similarity index 68%
rename from extensions/librdkafka/rdkafka_utils.h
rename to extensions/kafka/rdkafka_utils.h
index 8f89605ab..36a20d20b 100644
--- a/extensions/librdkafka/rdkafka_utils.h
+++ b/extensions/kafka/rdkafka_utils.h
@@ -17,9 +17,7 @@
 
 #pragma once
 
-#include <algorithm>
 #include <chrono>
-#include <memory>
 #include <optional>
 #include <string>
 #include <thread>
@@ -27,24 +25,43 @@
 #include <vector>
 
 #include "core/logging/LoggerConfiguration.h"
-#include "utils/gsl.h"
 #include "rdkafka.h"
 #include "utils/net/Ssl.h"
 
-namespace org {
-namespace apache {
-namespace nifi {
-namespace minifi {
-namespace utils {
+namespace org::apache::nifi::minifi::utils {
 
-enum class KafkaEncoding {
-  UTF8,
-  HEX
+enum class KafkaEncoding { UTF8, HEX };
+
+struct rd_kafka_headers_deleter {
+  void operator()(rd_kafka_headers_t* ptr) const noexcept { rd_kafka_headers_destroy(ptr); }
 };
+using rd_kafka_headers_unique_ptr = std::unique_ptr<rd_kafka_headers_t, rd_kafka_headers_deleter>;
+
+struct rd_kafka_topic_deleter {
+  void operator()(rd_kafka_topic_t* ptr) const noexcept { rd_kafka_topic_destroy(ptr); }
+};
+using rd_kafka_topic_unique_ptr = std::unique_ptr<rd_kafka_topic_t, rd_kafka_topic_deleter>;
 
 struct rd_kafka_conf_deleter {
-  void operator()(rd_kafka_conf_t* ptr) const noexcept { rd_kafka_conf_destroy(ptr); }
+  void operator()(rd_kafka_conf_t* p) const noexcept { rd_kafka_conf_destroy(p); }
+};
+using rd_kafka_conf_unique_ptr = std::unique_ptr<rd_kafka_conf_t, rd_kafka_conf_deleter>;
+
+struct rd_kafka_topic_conf_deleter {
+  void operator()(rd_kafka_topic_conf_t* p) const noexcept { rd_kafka_topic_conf_destroy(p); }
+};
+using rd_kafka_topic_conf_unique_ptr = std::unique_ptr<rd_kafka_topic_conf_t, rd_kafka_topic_conf_deleter>;
+
+struct rd_kafka_topic_partition_list_deleter {
+  void operator()(rd_kafka_topic_partition_list_t* ptr) const noexcept { rd_kafka_topic_partition_list_destroy(ptr); }
+};
+using rd_kafka_topic_partition_list_unique_ptr =
+    std::unique_ptr<rd_kafka_topic_partition_list_t, rd_kafka_topic_partition_list_deleter>;
+
+struct rd_kafka_message_deleter {
+  void operator()(rd_kafka_message_t* ptr) const noexcept { rd_kafka_message_destroy(ptr); }
 };
+using rd_kafka_message_unique_ptr = std::unique_ptr<rd_kafka_message_t, rd_kafka_message_deleter>;
 
 struct rd_kafka_producer_deleter {
   void operator()(rd_kafka_t* ptr) const noexcept {
@@ -56,6 +73,7 @@ struct rd_kafka_producer_deleter {
     rd_kafka_destroy(ptr);
   }
 };
+using rd_kafka_producer_unique_ptr = std::unique_ptr<rd_kafka_t, rd_kafka_producer_deleter>;
 
 struct rd_kafka_consumer_deleter {
   void operator()(rd_kafka_t* ptr) const noexcept {
@@ -63,30 +81,12 @@ struct rd_kafka_consumer_deleter {
     rd_kafka_destroy(ptr);
   }
 };
+using rd_kafka_consumer_unique_ptr = std::unique_ptr<rd_kafka_t, rd_kafka_consumer_deleter>;
 
-struct rd_kafka_topic_partition_list_deleter {
-  void operator()(rd_kafka_topic_partition_list_t* ptr) const noexcept { rd_kafka_topic_partition_list_destroy(ptr); }
-};
-
-struct rd_kafka_topic_conf_deleter {
-  void operator()(rd_kafka_topic_conf_t* ptr) const noexcept { rd_kafka_topic_conf_destroy(ptr); }
-};
-struct rd_kafka_topic_deleter {
-  void operator()(rd_kafka_topic_t* ptr) const noexcept { rd_kafka_topic_destroy(ptr); }
-};
-
-struct rd_kafka_message_deleter {
-  void operator()(rd_kafka_message_t* ptr) const noexcept { rd_kafka_message_destroy(ptr); }
-};
-
-struct rd_kafka_headers_deleter {
-  void operator()(rd_kafka_headers_t* ptr) const noexcept { rd_kafka_headers_destroy(ptr); }
-};
-
-template <typename T>
+template<typename T>
 void kafka_headers_for_each(const rd_kafka_headers_t& headers, T key_value_handle) {
-  const char *key;  // Null terminated, not to be freed
-  const void *value;
+  const char* key = nullptr;  // Null terminated, not to be freed
+  const void* value = nullptr;
   std::size_t size;
   for (std::size_t i = 0; RD_KAFKA_RESP_ERR_NO_ERROR == rd_kafka_header_get_all(&headers, i, &key, &value, &size); ++i) {
     key_value_handle(std::string(key), std::span<const char>(static_cast<const char*>(value), size));
@@ -94,13 +94,9 @@ void kafka_headers_for_each(const rd_kafka_headers_t& headers, T key_value_handl
 }
 
 void setKafkaConfigurationField(rd_kafka_conf_t& configuration, const std::string& field_name, const std::string& value);
-void print_topics_list(core::logging::Logger& logger, rd_kafka_topic_partition_list_t& kf_topic_partition_list);
+void print_topics_list(core::logging::Logger& logger, const rd_kafka_topic_partition_list_t& kf_topic_partition_list);
 void print_kafka_message(const rd_kafka_message_t& rkmessage, core::logging::Logger& logger);
 std::string get_encoded_string(const std::string& input, KafkaEncoding encoding);
 std::optional<std::string> get_encoded_message_key(const rd_kafka_message_t& message, KafkaEncoding encoding);
 
-}  // namespace utils
-}  // namespace minifi
-}  // namespace nifi
-}  // namespace apache
-}  // namespace org
+}  // namespace org::apache::nifi::minifi::utils
diff --git a/extensions/librdkafka/tests/CMakeLists.txt b/extensions/kafka/tests/CMakeLists.txt
similarity index 92%
rename from extensions/librdkafka/tests/CMakeLists.txt
rename to extensions/kafka/tests/CMakeLists.txt
index 8bf4579f1..98341cf8f 100644
--- a/extensions/librdkafka/tests/CMakeLists.txt
+++ b/extensions/kafka/tests/CMakeLists.txt
@@ -17,13 +17,13 @@
 # under the License.
 #
 
-file(GLOB KAFKA_INTEGRATION_TESTS  "*.cpp")
+file(GLOB KAFKA_INTEGRATION_TESTS "*.cpp")
 
 SET(EXTENSIONS_TEST_COUNT 0)
-FOREACH(testfile ${KAFKA_INTEGRATION_TESTS})
+FOREACH (testfile ${KAFKA_INTEGRATION_TESTS})
     get_filename_component(testfilename "${testfile}" NAME_WE)
     add_minifi_executable("${testfilename}" "${testfile}")
-    target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/librdkafka")
+    target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/kafka")
     createTests("${testfilename}")
     target_link_libraries(${testfilename} Catch2WithMain)
     target_link_libraries(${testfilename} minifi-rdkafka-extensions)
diff --git a/extensions/librdkafka/tests/PublishKafkaTests.cpp b/extensions/kafka/tests/PublishKafkaTests.cpp
similarity index 52%
rename from extensions/librdkafka/tests/PublishKafkaTests.cpp
rename to extensions/kafka/tests/PublishKafkaTests.cpp
index 440f4ddd2..dbefd9c39 100644
--- a/extensions/librdkafka/tests/PublishKafkaTests.cpp
+++ b/extensions/kafka/tests/PublishKafkaTests.cpp
@@ -34,4 +34,38 @@ TEST_CASE("Scheduling should fail when batch size is larger than the max queue m
   REQUIRE_THROWS_WITH(test_controller.trigger(""), "Process Schedule Operation: Invalid configuration: Batch Size cannot be larger than Queue Max Message");
 }
 
+TEST_CASE("Compress Codec property") {
+  using processors::PublishKafka;
+  SingleProcessorTestController test_controller(std::make_unique<PublishKafka>("PublishKafka"));
+  test_controller.getProcessor<PublishKafka>()->setProperty(PublishKafka::ClientName, "test_client");
+  test_controller.getProcessor<PublishKafka>()->setProperty(PublishKafka::SeedBrokers, "test_seedbroker");
+  test_controller.getProcessor<PublishKafka>()->setProperty(PublishKafka::Topic, "test_topic");
+  test_controller.getProcessor<PublishKafka>()->setProperty(PublishKafka::MessageTimeOut, "10ms");
+
+  SECTION("none") {
+    REQUIRE_NOTHROW(test_controller.getProcessor<PublishKafka>()->setProperty(PublishKafka::CompressCodec, "none"));
+    REQUIRE_NOTHROW(test_controller.trigger("input"));
+  }
+  SECTION("gzip") {
+    REQUIRE_NOTHROW(test_controller.getProcessor<PublishKafka>()->setProperty(PublishKafka::CompressCodec, "gzip"));
+    REQUIRE_NOTHROW(test_controller.trigger("input"));
+  }
+  SECTION("snappy") {
+    REQUIRE_NOTHROW(test_controller.getProcessor<PublishKafka>()->setProperty(PublishKafka::CompressCodec, "snappy"));
+    REQUIRE_NOTHROW(test_controller.trigger("input"));
+  }
+  SECTION("lz4") {
+    REQUIRE_NOTHROW(test_controller.getProcessor<PublishKafka>()->setProperty(PublishKafka::CompressCodec, "lz4"));
+    REQUIRE_NOTHROW(test_controller.trigger("input"));
+  }
+  SECTION("zstd") {
+    REQUIRE_NOTHROW(test_controller.getProcessor<PublishKafka>()->setProperty(PublishKafka::CompressCodec, "zstd"));
+    REQUIRE_NOTHROW(test_controller.trigger("input"));
+  }
+  SECTION("foo") {
+    REQUIRE_NOTHROW(test_controller.getProcessor<PublishKafka>()->setProperty(PublishKafka::CompressCodec, "foo"));
+    REQUIRE_THROWS(test_controller.trigger("input"));
+  }
+}
+
 }  // namespace org::apache::nifi::minifi::test
diff --git a/extensions/librdkafka/ConsumeKafka.h b/extensions/librdkafka/ConsumeKafka.h
deleted file mode 100644
index a8c820c36..000000000
--- a/extensions/librdkafka/ConsumeKafka.h
+++ /dev/null
@@ -1,273 +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.
- */
-
-#pragma once
-
-#include <memory>
-#include <optional>
-#include <string>
-#include <utility>
-#include <vector>
-
-#include "KafkaProcessorBase.h"
-#include "core/logging/LoggerConfiguration.h"
-#include "core/PropertyDefinition.h"
-#include "core/PropertyDefinitionBuilder.h"
-#include "core/PropertyType.h"
-#include "core/RelationshipDefinition.h"
-#include "io/StreamPipe.h"
-#include "rdkafka.h"
-#include "rdkafka_utils.h"
-#include "KafkaConnection.h"
-#include "utils/ArrayUtils.h"
-
-namespace org::apache::nifi::minifi {
-
-class FlowFileRecord;
-
-namespace core {
-class ConsumeKafkaMaxPollTimePropertyType : public TimePeriodPropertyType {
- public:
-  constexpr ~ConsumeKafkaMaxPollTimePropertyType() override { }  // NOLINT see comment at grandparent
-
-  [[nodiscard]] ValidationResult validate(const std::string& subject, const std::string& input) const override;
-};
-
-inline constexpr ConsumeKafkaMaxPollTimePropertyType CONSUME_KAFKA_MAX_POLL_TIME_TYPE{};
-}  // namespace core
-
-namespace processors {
-
-class ConsumeKafka : public KafkaProcessorBase {
- public:
-  // Security Protocol allowable values
-  static constexpr std::string_view SECURITY_PROTOCOL_PLAINTEXT = "plaintext";
-  static constexpr std::string_view SECURITY_PROTOCOL_SSL = "ssl";
-
-  // Topic Name Format allowable values
-  static constexpr std::string_view TOPIC_FORMAT_NAMES = "Names";
-  static constexpr std::string_view TOPIC_FORMAT_PATTERNS = "Patterns";
-
-  // Offset Reset allowable values
-  static constexpr std::string_view OFFSET_RESET_EARLIEST = "earliest";
-  static constexpr std::string_view OFFSET_RESET_LATEST = "latest";
-  static constexpr std::string_view OFFSET_RESET_NONE = "none";
-
-  // Key Attribute Encoding allowable values
-  static constexpr std::string_view KEY_ATTR_ENCODING_UTF_8 = "UTF-8";
-  static constexpr std::string_view KEY_ATTR_ENCODING_HEX = "Hex";
-
-  // Message Header Encoding allowable values
-  static constexpr std::string_view MSG_HEADER_ENCODING_UTF_8 = "UTF-8";
-  static constexpr std::string_view MSG_HEADER_ENCODING_HEX = "Hex";
-
-  // Duplicate Header Handling allowable values
-  static constexpr std::string_view MSG_HEADER_KEEP_FIRST = "Keep First";
-  static constexpr std::string_view MSG_HEADER_KEEP_LATEST = "Keep Latest";
-  static constexpr std::string_view MSG_HEADER_COMMA_SEPARATED_MERGE = "Comma-separated Merge";
-
-  // Flowfile attributes written
-  static constexpr std::string_view KAFKA_COUNT_ATTR = "kafka.count";  // Always 1 until we start supporting merging from batches
-  static constexpr std::string_view KAFKA_MESSAGE_KEY_ATTR = "kafka.key";
-  static constexpr std::string_view KAFKA_OFFSET_ATTR = "kafka.offset";
-  static constexpr std::string_view KAFKA_PARTITION_ATTR = "kafka.partition";
-  static constexpr std::string_view KAFKA_TOPIC_ATTR = "kafka.topic";
-
-  static constexpr std::string_view DEFAULT_MAX_POLL_RECORDS = "10000";
-  static constexpr std::string_view DEFAULT_MAX_POLL_TIME = "4 seconds";
-
-  static constexpr const std::size_t METADATA_COMMUNICATIONS_TIMEOUT_MS{ 60000 };
-
-  EXTENSIONAPI static constexpr const char* Description = "Consumes messages from Apache Kafka and transform them into MiNiFi FlowFiles. "
-      "The application should make sure that the processor is triggered at regular intervals, even if no messages are expected, "
-      "to serve any queued callbacks waiting to be called. Rebalancing can also only happen on trigger.";
-
-  EXTENSIONAPI static constexpr auto KafkaBrokers = core::PropertyDefinitionBuilder<>::createProperty("Kafka Brokers")
-      .withDescription("A comma-separated list of known Kafka Brokers in the format <host>:<port>.")
-      .withPropertyType(core::StandardPropertyTypes::NON_BLANK_TYPE)
-      .withDefaultValue("localhost:9092")
-      .supportsExpressionLanguage(true)
-      .isRequired(true)
-      .build();
-  EXTENSIONAPI static constexpr auto TopicNames = core::PropertyDefinitionBuilder<>::createProperty("Topic Names")
-      .withDescription("The name of the Kafka Topic(s) to pull from. Multiple topic names are supported as a comma separated list.")
-      .supportsExpressionLanguage(true)
-      .isRequired(true)
-      .build();
-  EXTENSIONAPI static constexpr auto TopicNameFormat = core::PropertyDefinitionBuilder<2>::createProperty("Topic Name Format")
-      .withDescription("Specifies whether the Topic(s) provided are a comma separated list of names or a single regular expression. "
-          "Using regular expressions does not automatically discover Kafka topics created after the processor started.")
-      .withAllowedValues({TOPIC_FORMAT_NAMES, TOPIC_FORMAT_PATTERNS})
-      .withDefaultValue(TOPIC_FORMAT_NAMES)
-      .isRequired(true)
-      .build();
-  EXTENSIONAPI static constexpr auto HonorTransactions = core::PropertyDefinitionBuilder<>::createProperty("Honor Transactions")
-      .withDescription(
-          "Specifies whether or not MiNiFi should honor transactional guarantees when communicating with Kafka. If false, the Processor will use an \"isolation level\" of "
-          "read_uncomitted. This means that messages will be received as soon as they are written to Kafka but will be pulled, even if the producer cancels the transactions. "
-          "If this value is true, MiNiFi will not receive any messages for which the producer's transaction was canceled, but this can result in some latency since the consumer "
-          "must wait for the producer to finish its entire transaction instead of pulling as the messages become available.")
-      .withPropertyType(core::StandardPropertyTypes::BOOLEAN_TYPE)
-      .withDefaultValue("true")
-      .isRequired(true)
-      .build();
-  EXTENSIONAPI static constexpr auto GroupID = core::PropertyDefinitionBuilder<>::createProperty("Group ID")
-      .withDescription("A Group ID is used to identify consumers that are within the same consumer group. Corresponds to Kafka's 'group.id' property.")
-      .supportsExpressionLanguage(true)
-      .isRequired(true)
-      .build();
-  EXTENSIONAPI static constexpr auto OffsetReset = core::PropertyDefinitionBuilder<3>::createProperty("Offset Reset")
-      .withDescription("Allows you to manage the condition when there is no initial offset in Kafka or if the current offset does not exist any more on the server (e.g. because that "
-          "data has been deleted). Corresponds to Kafka's 'auto.offset.reset' property.")
-      .withAllowedValues({OFFSET_RESET_EARLIEST, OFFSET_RESET_LATEST, OFFSET_RESET_NONE})
-      .withDefaultValue(OFFSET_RESET_LATEST)
-      .isRequired(true)
-      .build();
-  EXTENSIONAPI static constexpr auto KeyAttributeEncoding = core::PropertyDefinitionBuilder<2>::createProperty("Key Attribute Encoding")
-      .withDescription("FlowFiles that are emitted have an attribute named 'kafka.key'. This property dictates how the value of the attribute should be encoded.")
-      .withAllowedValues({KEY_ATTR_ENCODING_UTF_8, KEY_ATTR_ENCODING_HEX})
-      .withDefaultValue(KEY_ATTR_ENCODING_UTF_8)
-      .isRequired(true)
-      .build();
-  EXTENSIONAPI static constexpr auto MessageDemarcator = core::PropertyDefinitionBuilder<>::createProperty("Message Demarcator")
-      .withDescription("Since KafkaConsumer receives messages in batches, you have an option to output FlowFiles which contains all Kafka messages in a single batch "
-          "for a given topic and partition and this property allows you to provide a string (interpreted as UTF-8) to use for demarcating apart multiple Kafka messages. "
-          "This is an optional property and if not provided each Kafka message received will result in a single FlowFile which time it is triggered. ")
-      .supportsExpressionLanguage(true)
-      .build();
-  EXTENSIONAPI static constexpr auto MessageHeaderEncoding = core::PropertyDefinitionBuilder<2>::createProperty("Message Header Encoding")
-      .withDescription("Any message header that is found on a Kafka message will be added to the outbound FlowFile as an attribute. This property indicates the Character Encoding "
-          "to use for deserializing the headers.")
-      .withAllowedValues({MSG_HEADER_ENCODING_UTF_8, MSG_HEADER_ENCODING_HEX})
-      .withDefaultValue(MSG_HEADER_ENCODING_UTF_8)
-      .build();
-  EXTENSIONAPI static constexpr auto HeadersToAddAsAttributes = core::PropertyDefinitionBuilder<>::createProperty("Headers To Add As Attributes")
-      .withDescription("A comma separated list to match against all message headers. Any message header whose name matches an item from the list will be added to the FlowFile "
-          "as an Attribute. If not specified, no Header values will be added as FlowFile attributes. The behaviour on when multiple headers of the same name are present is set using "
-          "the Duplicate Header Handling attribute.")
-      .build();
-  EXTENSIONAPI static constexpr auto DuplicateHeaderHandling = core::PropertyDefinitionBuilder<3>::createProperty("Duplicate Header Handling")
-      .withDescription("For headers to be added as attributes, this option specifies how to handle cases where multiple headers are present with the same key. "
-          "For example in case of receiving these two headers: \"Accept: text/html\" and \"Accept: application/xml\" and we want to attach the value of \"Accept\" "
-          "as a FlowFile attribute:\n"
-          " - \"Keep First\" attaches: \"Accept -> text/html\"\n"
-          " - \"Keep Latest\" attaches: \"Accept -> application/xml\"\n"
-          " - \"Comma-separated Merge\" attaches: \"Accept -> text/html, application/xml\"\n")
-      .withAllowedValues({MSG_HEADER_KEEP_FIRST, MSG_HEADER_KEEP_LATEST, MSG_HEADER_COMMA_SEPARATED_MERGE})
-      .withDefaultValue(MSG_HEADER_KEEP_LATEST)  // Mirroring NiFi behaviour
-      .build();
-  EXTENSIONAPI static constexpr auto MaxPollRecords = core::PropertyDefinitionBuilder<>::createProperty("Max Poll Records")
-      .withDescription("Specifies the maximum number of records Kafka should return when polling each time the processor is triggered.")
-      .withPropertyType(core::StandardPropertyTypes::UNSIGNED_LONG_TYPE)
-      .withDefaultValue(DEFAULT_MAX_POLL_RECORDS)
-      .build();
-  EXTENSIONAPI static constexpr auto MaxPollTime = core::PropertyDefinitionBuilder<>::createProperty("Max Poll Time")
-      .withDescription("Specifies the maximum amount of time the consumer can use for polling data from the brokers. "
-          "Polling is a blocking operation, so the upper limit of this value is specified in 4 seconds.")
-      .withPropertyType(core::CONSUME_KAFKA_MAX_POLL_TIME_TYPE)
-      .withDefaultValue(DEFAULT_MAX_POLL_TIME)
-      .isRequired(true)
-      .build();
-  EXTENSIONAPI static constexpr auto SessionTimeout = core::PropertyDefinitionBuilder<>::createProperty("Session Timeout")
-      .withDescription("Client group session and failure detection timeout. The consumer sends periodic heartbeats "
-          "to indicate its liveness to the broker. If no hearts are received by the broker for a group member within "
-          "the session timeout, the broker will remove the consumer from the group and trigger a rebalance. "
-          "The allowed range is configured with the broker configuration properties group.min.session.timeout.ms and group.max.session.timeout.ms.")
-      .withPropertyType(core::StandardPropertyTypes::TIME_PERIOD_TYPE)
-      .withDefaultValue("60 seconds")
-      .build();
-  EXTENSIONAPI static constexpr auto Properties = utils::array_cat(KafkaProcessorBase::Properties, std::to_array<core::PropertyReference>({
-      KafkaBrokers,
-      TopicNames,
-      TopicNameFormat,
-      HonorTransactions,
-      GroupID,
-      OffsetReset,
-      KeyAttributeEncoding,
-      MessageDemarcator,
-      MessageHeaderEncoding,
-      HeadersToAddAsAttributes,
-      DuplicateHeaderHandling,
-      MaxPollRecords,
-      MaxPollTime,
-      SessionTimeout
-  }));
-
-
-  EXTENSIONAPI static constexpr auto Success = core::RelationshipDefinition{"success",
-      "Incoming Kafka messages as flowfiles. Depending on the demarcation strategy, this can be one or multiple flowfiles per message."};
-  EXTENSIONAPI static constexpr auto Relationships = std::array{Success};
-
-  EXTENSIONAPI static constexpr bool SupportsDynamicProperties = true;
-  EXTENSIONAPI static constexpr bool SupportsDynamicRelationships = false;
-  EXTENSIONAPI static constexpr core::annotation::Input InputRequirement = core::annotation::Input::INPUT_FORBIDDEN;
-  EXTENSIONAPI static constexpr bool IsSingleThreaded = false;
-
-  ADD_COMMON_VIRTUAL_FUNCTIONS_FOR_PROCESSORS
-
-  explicit ConsumeKafka(std::string_view name, const utils::Identifier& uuid = utils::Identifier()) :
-      KafkaProcessorBase(name, uuid, core::logging::LoggerFactory<ConsumeKafka>::getLogger(uuid)) {}
-
-  ~ConsumeKafka() override = default;
-
-  void onSchedule(core::ProcessContext& context, core::ProcessSessionFactory& session_factory) override;
-  void onTrigger(core::ProcessContext& context, core::ProcessSession& session) override;
-  void initialize() override;
-
- private:
-  void create_topic_partition_list();
-  void extend_config_from_dynamic_properties(const core::ProcessContext& context);
-  void configure_new_connection(core::ProcessContext& context);
-  static std::string extract_message(const rd_kafka_message_t& rkmessage);
-  std::vector<std::unique_ptr<rd_kafka_message_t, utils::rd_kafka_message_deleter>> poll_kafka_messages();
-  utils::KafkaEncoding key_attr_encoding_attr_to_enum() const;
-  utils::KafkaEncoding message_header_encoding_attr_to_enum() const;
-  std::string resolve_duplicate_headers(const std::vector<std::string>& matching_headers) const;
-  std::vector<std::string> get_matching_headers(const rd_kafka_message_t& message, const std::string& header_name) const;
-  std::vector<std::pair<std::string, std::string>> get_flowfile_attributes_from_message_header(const rd_kafka_message_t& message) const;
-  void add_kafka_attributes_to_flowfile(std::shared_ptr<FlowFileRecord>& flow_file, const rd_kafka_message_t& message) const;
-  std::optional<std::vector<std::shared_ptr<FlowFileRecord>>> transform_pending_messages_into_flowfiles(core::ProcessSession& session) const;
-  void process_pending_messages(core::ProcessSession& session);
-
-  std::string kafka_brokers_;
-  std::vector<std::string> topic_names_;
-  std::string topic_name_format_;
-  bool honor_transactions_{};
-  std::string group_id_;
-  std::string offset_reset_;
-  std::string key_attribute_encoding_;
-  std::string message_demarcator_;
-  std::string message_header_encoding_;
-  std::string duplicate_header_handling_;
-  std::vector<std::string> headers_to_add_as_attributes_;
-  std::size_t max_poll_records_{};
-  std::chrono::milliseconds max_poll_time_milliseconds_{};
-  std::chrono::milliseconds session_timeout_milliseconds_{};
-
-  std::unique_ptr<rd_kafka_t, utils::rd_kafka_consumer_deleter> consumer_;
-  std::unique_ptr<rd_kafka_conf_t, utils::rd_kafka_conf_deleter> conf_;
-  std::unique_ptr<rd_kafka_topic_partition_list_t, utils::rd_kafka_topic_partition_list_deleter> kf_topic_partition_list_;
-
-  // Intermediate container type for messages that have been processed, but are
-  // not yet persisted (eg. in case of I/O error)
-  std::vector<std::unique_ptr<rd_kafka_message_t, utils::rd_kafka_message_deleter>> pending_messages_;
-
-  std::mutex do_not_call_on_trigger_concurrently_;
-};
-
-}  // namespace processors
-}  // namespace org::apache::nifi::minifi
diff --git a/extensions/librdkafka/KafkaProcessorBase.h b/extensions/librdkafka/KafkaProcessorBase.h
deleted file mode 100644
index 952865554..000000000
--- a/extensions/librdkafka/KafkaProcessorBase.h
+++ /dev/null
@@ -1,107 +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.
- */
-#pragma once
-
-#include <memory>
-#include <optional>
-#include <string>
-#include <utility>
-
-#include "controllers/SSLContextService.h"
-#include "core/Core.h"
-#include "core/Processor.h"
-#include "core/PropertyDefinitionBuilder.h"
-#include "rdkafka_utils.h"
-#include "utils/Enum.h"
-#include "utils/net/Ssl.h"
-
-namespace org::apache::nifi::minifi::processors {
-
-namespace kafka {
-enum class SecurityProtocolOption {
-  plaintext,
-  ssl,
-  sasl_plaintext,
-  sasl_ssl
-};
-
-enum class SASLMechanismOption {
-  GSSAPI,
-  PLAIN
-};
-}  // namespace kafka
-
-class KafkaProcessorBase : public core::Processor {
- public:
-  EXTENSIONAPI static constexpr auto SSLContextService = core::PropertyDefinitionBuilder<>::createProperty("SSL Context Service")
-      .withDescription("SSL Context Service Name")
-      .withAllowedTypes<minifi::controllers::SSLContextService>()
-      .build();
-  EXTENSIONAPI static constexpr auto SecurityProtocol = core::PropertyDefinitionBuilder<magic_enum::enum_count<kafka::SecurityProtocolOption>()>::createProperty("Security Protocol")
-      .withDescription("Protocol used to communicate with brokers. Corresponds to Kafka's 'security.protocol' property.")
-      .withDefaultValue(magic_enum::enum_name(kafka::SecurityProtocolOption::plaintext))
-      .withAllowedValues(magic_enum::enum_names<kafka::SecurityProtocolOption>())
-      .isRequired(true)
-      .build();
-  EXTENSIONAPI static constexpr auto KerberosServiceName = core::PropertyDefinitionBuilder<>::createProperty("Kerberos Service Name")
-      .withDescription("Kerberos Service Name")
-      .build();
-  EXTENSIONAPI static constexpr auto KerberosPrincipal = core::PropertyDefinitionBuilder<>::createProperty("Kerberos Principal")
-      .withDescription("Kerberos Principal")
-      .build();
-  EXTENSIONAPI static constexpr auto KerberosKeytabPath = core::PropertyDefinitionBuilder<>::createProperty("Kerberos Keytab Path")
-      .withDescription("The path to the location on the local filesystem where the kerberos keytab is located. Read permission on the file is required.")
-      .build();
-  EXTENSIONAPI static constexpr auto SASLMechanism = core::PropertyDefinitionBuilder<magic_enum::enum_count<kafka::SASLMechanismOption>()>::createProperty("SASL Mechanism")
-      .withDescription("The SASL mechanism to use for authentication. Corresponds to Kafka's 'sasl.mechanism' property.")
-      .withDefaultValue(magic_enum::enum_name(kafka::SASLMechanismOption::GSSAPI))
-      .withAllowedValues(magic_enum::enum_names<kafka::SASLMechanismOption>())
-      .isRequired(true)
-      .build();
-  EXTENSIONAPI static constexpr auto Username = core::PropertyDefinitionBuilder<>::createProperty("Username")
-      .withDescription("The username when the SASL Mechanism is sasl_plaintext")
-      .build();
-  EXTENSIONAPI static constexpr auto Password = core::PropertyDefinitionBuilder<>::createProperty("Password")
-      .withDescription("The password for the given username when the SASL Mechanism is sasl_plaintext")
-      .isSensitive(true)
-      .build();
-  EXTENSIONAPI static constexpr auto Properties = std::to_array<core::PropertyReference>({
-      SSLContextService,
-      SecurityProtocol,
-      KerberosServiceName,
-      KerberosPrincipal,
-      KerberosKeytabPath,
-      SASLMechanism,
-      Username,
-      Password
-  });
-
-
-  KafkaProcessorBase(std::string_view name, const utils::Identifier& uuid, std::shared_ptr<core::logging::Logger> logger)
-      : core::Processor(name, uuid),
-        logger_(std::move(logger)) {
-  }
-
- protected:
-  virtual std::optional<utils::net::SslData> getSslData(core::ProcessContext& context) const;
-  void setKafkaAuthenticationParameters(core::ProcessContext& context, gsl::not_null<rd_kafka_conf_t*> config);
-
-  kafka::SecurityProtocolOption security_protocol_{};
-  std::shared_ptr<core::logging::Logger> logger_;
-};
-
-}  // namespace org::apache::nifi::minifi::processors
diff --git a/extensions/librdkafka/PublishKafka.h b/extensions/librdkafka/PublishKafka.h
deleted file mode 100644
index df38820ec..000000000
--- a/extensions/librdkafka/PublishKafka.h
+++ /dev/null
@@ -1,253 +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.
- */
-#pragma once
-
-#include <atomic>
-#include <cstdint>
-#include <map>
-#include <memory>
-#include <mutex>
-#include <set>
-#include <string>
-#include <condition_variable>
-#include <utility>
-#include <vector>
-
-#include "KafkaProcessorBase.h"
-#include "utils/GeneralUtils.h"
-#include "FlowFileRecord.h"
-#include "core/ProcessSession.h"
-#include "core/Core.h"
-#include "core/PropertyDefinition.h"
-#include "core/PropertyDefinitionBuilder.h"
-#include "core/PropertyType.h"
-#include "core/RelationshipDefinition.h"
-#include "core/logging/LoggerConfiguration.h"
-#include "core/logging/Logger.h"
-#include "controllers/SSLContextService.h"
-#include "rdkafka.h"
-#include "KafkaConnection.h"
-#include "utils/ArrayUtils.h"
-#include "utils/RegexUtils.h"
-
-namespace org::apache::nifi::minifi::processors {
-
-class PublishKafka : public KafkaProcessorBase {
- public:
-  static constexpr std::string_view COMPRESSION_CODEC_NONE = "none";
-  static constexpr std::string_view COMPRESSION_CODEC_GZIP = "gzip";
-  static constexpr std::string_view COMPRESSION_CODEC_SNAPPY = "snappy";
-  static constexpr std::string_view ROUND_ROBIN_PARTITIONING = "Round Robin";
-  static constexpr std::string_view RANDOM_PARTITIONING = "Random Robin";
-  static constexpr std::string_view USER_DEFINED_PARTITIONING = "User-Defined";
-  static constexpr std::string_view DELIVERY_REPLICATED = "all";
-  static constexpr std::string_view DELIVERY_ONE_NODE = "1";
-  static constexpr std::string_view DELIVERY_BEST_EFFORT = "0";
-  static constexpr std::string_view KAFKA_KEY_ATTRIBUTE = "kafka.key";
-
-  EXTENSIONAPI static constexpr const char* Description = "This Processor puts the contents of a FlowFile to a Topic in Apache Kafka. "
-      "The content of a FlowFile becomes the contents of a Kafka message. "
-      "This message is optionally assigned a key by using the <Kafka Key> Property.";
-
-  EXTENSIONAPI static constexpr auto SeedBrokers = core::PropertyDefinitionBuilder<>::createProperty("Known Brokers")
-      .withDescription("A comma-separated list of known Kafka Brokers in the format <host>:<port>")
-      .isRequired(true)
-      .supportsExpressionLanguage(true)
-      .build();
-  EXTENSIONAPI static constexpr auto Topic = core::PropertyDefinitionBuilder<>::createProperty("Topic Name")
-      .withDescription("The Kafka Topic of interest")
-      .isRequired(true)
-      .supportsExpressionLanguage(true)
-      .build();
-  EXTENSIONAPI static constexpr auto DeliveryGuarantee = core::PropertyDefinitionBuilder<>::createProperty("Delivery Guarantee")
-      .withDescription("Specifies the requirement for guaranteeing that a message is sent to Kafka. "
-          "Valid values are 0 (do not wait for acks), "
-          "-1 or all (block until message is committed by all in sync replicas) "
-          "or any concrete number of nodes.")
-      .isRequired(false)
-      .supportsExpressionLanguage(true)
-      .withDefaultValue(DELIVERY_ONE_NODE)
-      .build();
-  EXTENSIONAPI static constexpr auto MaxMessageSize = core::PropertyDefinitionBuilder<>::createProperty("Max Request Size")
-      .withDescription("Maximum Kafka protocol request message size")
-      .isRequired(false)
-      .build();
-  EXTENSIONAPI static constexpr auto RequestTimeOut = core::PropertyDefinitionBuilder<>::createProperty("Request Timeout")
-      .withDescription("The ack timeout of the producer request")
-      .isRequired(false)
-      .withPropertyType(core::StandardPropertyTypes::TIME_PERIOD_TYPE)
-      .withDefaultValue("10 sec")
-      .build();
-  EXTENSIONAPI static constexpr auto MessageTimeOut = core::PropertyDefinitionBuilder<>::createProperty("Message Timeout")
-      .withDescription("The total time sending a message could take")
-      .isRequired(false)
-      .withPropertyType(core::StandardPropertyTypes::TIME_PERIOD_TYPE)
-      .withDefaultValue("30 sec")
-      .build();
-  EXTENSIONAPI static constexpr auto ClientName = core::PropertyDefinitionBuilder<>::createProperty("Client Name")
-      .withDescription("Client Name to use when communicating with Kafka")
-      .isRequired(true)
-      .supportsExpressionLanguage(true)
-      .build();
-  EXTENSIONAPI static constexpr auto BatchSize = core::PropertyDefinitionBuilder<>::createProperty("Batch Size")
-      .withDescription("Maximum number of messages batched in one MessageSet")
-      .isRequired(false)
-      .withPropertyType(core::StandardPropertyTypes::UNSIGNED_INT_TYPE)
-      .withDefaultValue("10")
-      .build();
-  EXTENSIONAPI static constexpr auto TargetBatchPayloadSize = core::PropertyDefinitionBuilder<>::createProperty("Target Batch Payload Size")
-      .withDescription("The target total payload size for a batch. 0 B means unlimited (Batch Size is still applied).")
-      .isRequired(false)
-      .withPropertyType(core::StandardPropertyTypes::DATA_SIZE_TYPE)
-      .withDefaultValue("512 KB")
-      .build();
-  EXTENSIONAPI static constexpr auto AttributeNameRegex = core::PropertyDefinitionBuilder<>::createProperty("Attributes to Send as Headers")
-      .withDescription("Any attribute whose name matches the regex will be added to the Kafka messages as a Header")
-      .build();
-  EXTENSIONAPI static constexpr auto QueueBufferMaxTime = core::PropertyDefinitionBuilder<>::createProperty("Queue Buffering Max Time")
-      .withDescription("Delay to wait for messages in the producer queue to accumulate before constructing message batches")
-      .isRequired(false)
-      .withPropertyType(core::StandardPropertyTypes::TIME_PERIOD_TYPE)
-      .withDefaultValue("5 millis")
-      .build();
-  EXTENSIONAPI static constexpr auto QueueBufferMaxSize = core::PropertyDefinitionBuilder<>::createProperty("Queue Max Buffer Size")
-      .withDescription("Maximum total message size sum allowed on the producer queue")
-      .isRequired(false)
-      .withPropertyType(core::StandardPropertyTypes::DATA_SIZE_TYPE)
-      .withDefaultValue("1 MB")
-      .build();
-  EXTENSIONAPI static constexpr auto QueueBufferMaxMessage = core::PropertyDefinitionBuilder<>::createProperty("Queue Max Message")
-      .withDescription("Maximum number of messages allowed on the producer queue")
-      .isRequired(false)
-      .withPropertyType(core::StandardPropertyTypes::UNSIGNED_LONG_TYPE)
-      .withDefaultValue("1000")
-      .build();
-  EXTENSIONAPI static constexpr auto CompressCodec = core::PropertyDefinitionBuilder<3>::createProperty("Compress Codec")
-      .withDescription("compression codec to use for compressing message sets")
-      .isRequired(false)
-      .withAllowedValues({COMPRESSION_CODEC_NONE, COMPRESSION_CODEC_GZIP, COMPRESSION_CODEC_SNAPPY})
-      .withDefaultValue(COMPRESSION_CODEC_NONE)
-      .build();
-  EXTENSIONAPI static constexpr auto MaxFlowSegSize = core::PropertyDefinitionBuilder<>::createProperty("Max Flow Segment Size")
-      .withDescription("Maximum flow content payload segment size for the kafka record. 0 B means unlimited.")
-      .isRequired(false)
-      .withPropertyType(core::StandardPropertyTypes::DATA_SIZE_TYPE)
-      .withDefaultValue("0 B")
-      .build();
-  EXTENSIONAPI static constexpr auto SecurityCA = core::PropertyDefinitionBuilder<>::createProperty("Security CA")
-      .withDescription("DEPRECATED in favor of SSL Context Service. File or directory path to CA certificate(s) for verifying the broker's key")
-      .build();
-  EXTENSIONAPI static constexpr auto SecurityCert = core::PropertyDefinitionBuilder<>::createProperty("Security Cert")
-      .withDescription("DEPRECATED in favor of SSL Context Service.Path to client's public key (PEM) used for authentication")
-      .build();
-  EXTENSIONAPI static constexpr auto SecurityPrivateKey = core::PropertyDefinitionBuilder<>::createProperty("Security Private Key")
-      .withDescription("DEPRECATED in favor of SSL Context Service.Path to client's private key (PEM) used for authentication")
-      .build();
-  EXTENSIONAPI static constexpr auto SecurityPrivateKeyPassWord = core::PropertyDefinitionBuilder<>::createProperty("Security Pass Phrase")
-      .withDescription("DEPRECATED in favor of SSL Context Service.Private key passphrase")
-      .isSensitive(true)
-      .build();
-  EXTENSIONAPI static constexpr auto KafkaKey = core::PropertyDefinitionBuilder<>::createProperty("Kafka Key")
-      .withDescription("The key to use for the message. If not specified, the UUID of the flow file is used as the message key.")
-      .supportsExpressionLanguage(true)
-      .build();
-  EXTENSIONAPI static constexpr auto MessageKeyField = core::PropertyDefinitionBuilder<>::createProperty("Message Key Field")
-      .withDescription("DEPRECATED, does not work -- use Kafka Key instead")
-      .build();
-  EXTENSIONAPI static constexpr auto DebugContexts = core::PropertyDefinitionBuilder<>::createProperty("Debug contexts")
-      .withDescription("A comma-separated list of debug contexts to enable."
-          "Including: generic, broker, topic, metadata, feature, queue, msg, protocol, cgrp, security, fetch, interceptor, plugin, consumer, admin, eos, all")
-      .build();
-  EXTENSIONAPI static constexpr auto FailEmptyFlowFiles = core::PropertyDefinitionBuilder<>::createProperty("Fail empty flow files")
-      .withDescription("Keep backwards compatibility with <=0.7.0 bug which caused flow files with empty content to not be published to Kafka and forwarded to failure. The old behavior is "
-          "deprecated. Use connections to drop empty flow files!")
-      .isRequired(false)
-      .withPropertyType(core::StandardPropertyTypes::BOOLEAN_TYPE)
-      .withDefaultValue("true")
-      .build();
-  EXTENSIONAPI static constexpr auto Properties = utils::array_cat(KafkaProcessorBase::Properties, std::to_array<core::PropertyReference>({
-      SeedBrokers,
-      Topic,
-      DeliveryGuarantee,
-      MaxMessageSize,
-      RequestTimeOut,
-      MessageTimeOut,
-      ClientName,
-      BatchSize,
-      TargetBatchPayloadSize,
-      AttributeNameRegex,
-      QueueBufferMaxTime,
-      QueueBufferMaxSize,
-      QueueBufferMaxMessage,
-      CompressCodec,
-      MaxFlowSegSize,
-      SecurityCA,
-      SecurityCert,
-      SecurityPrivateKey,
-      SecurityPrivateKeyPassWord,
-      KafkaKey,
-      MessageKeyField,
-      DebugContexts,
-      FailEmptyFlowFiles
-  }));
-
-
-  EXTENSIONAPI static constexpr auto Success = core::RelationshipDefinition{"success", "Any FlowFile that is successfully sent to Kafka will be routed to this Relationship"};
-  EXTENSIONAPI static constexpr auto Failure = core::RelationshipDefinition{"failure", "Any FlowFile that cannot be sent to Kafka will be routed to this Relationship"};
-  EXTENSIONAPI static constexpr auto Relationships = std::array{Success, Failure};
-
-  EXTENSIONAPI static constexpr bool SupportsDynamicProperties = true;
-  EXTENSIONAPI static constexpr bool SupportsDynamicRelationships = false;
-  EXTENSIONAPI static constexpr core::annotation::Input InputRequirement = core::annotation::Input::INPUT_REQUIRED;
-  EXTENSIONAPI static constexpr bool IsSingleThreaded = false;
-
-  ADD_COMMON_VIRTUAL_FUNCTIONS_FOR_PROCESSORS
-
-  explicit PublishKafka(std::string_view name, const utils::Identifier& uuid = {})
-      : KafkaProcessorBase(name, uuid, core::logging::LoggerFactory<PublishKafka>::getLogger(uuid)) {
-  }
-
-  ~PublishKafka() override = default;
-
-  void onTrigger(core::ProcessContext& context, core::ProcessSession& session) override;
-  void initialize() override;
-  void onSchedule(core::ProcessContext& context, core::ProcessSessionFactory& sessionFactory) override;
-  void notifyStop() override;
-
-  class Messages;
-
- protected:
-  bool configureNewConnection(core::ProcessContext& context);
-  bool createNewTopic(core::ProcessContext& context, const std::string& topic_name, const std::shared_ptr<core::FlowFile>& flow_file);
-  std::optional<utils::net::SslData> getSslData(core::ProcessContext& context) const override;
-
- private:
-  KafkaConnectionKey key_;
-  std::unique_ptr<KafkaConnection> conn_;
-  std::mutex connection_mutex_;
-
-  uint32_t batch_size_{};
-  uint64_t target_batch_payload_size_{};
-  uint64_t max_flow_seg_size_{};
-  std::optional<utils::Regex> attributeNameRegex_;
-
-  std::atomic<bool> interrupted_{false};
-  std::mutex messages_mutex_;  // If both connection_mutex_ and messages_mutex_ are needed, always take connection_mutex_ first to avoid deadlock
-  std::set<std::shared_ptr<Messages>> messages_set_;
-};
-
-}  // namespace org::apache::nifi::minifi::processors
diff --git a/thirdparty/librdkafka/0001-remove-findLZ4-and-findZSTD.patch b/thirdparty/librdkafka/0001-remove-findLZ4-and-findZSTD.patch
new file mode 100644
index 000000000..2d7475f54
--- /dev/null
+++ b/thirdparty/librdkafka/0001-remove-findLZ4-and-findZSTD.patch
@@ -0,0 +1,92 @@
+From a0a044836feab9047eed211d37128bc99a25673e Mon Sep 17 00:00:00 2001
+From: Martin Zink <ma...@apache.org>
+Date: Tue, 22 Oct 2024 09:20:37 +0200
+Subject: [PATCH] remove findLZ4 and findZSTD
+
+---
+ packaging/cmake/Modules/FindLZ4.cmake  | 38 --------------------------
+ packaging/cmake/Modules/FindZSTD.cmake | 27 ------------------
+ 2 files changed, 65 deletions(-)
+ delete mode 100644 packaging/cmake/Modules/FindLZ4.cmake
+ delete mode 100644 packaging/cmake/Modules/FindZSTD.cmake
+
+diff --git a/packaging/cmake/Modules/FindLZ4.cmake b/packaging/cmake/Modules/FindLZ4.cmake
+deleted file mode 100644
+index 594c4290..00000000
+--- a/packaging/cmake/Modules/FindLZ4.cmake
++++ /dev/null
+@@ -1,38 +0,0 @@
+-find_path(LZ4_INCLUDE_DIR
+-  NAMES lz4.h
+-  DOC "lz4 include directory")
+-mark_as_advanced(LZ4_INCLUDE_DIR)
+-find_library(LZ4_LIBRARY
+-  NAMES lz4
+-  DOC "lz4 library")
+-mark_as_advanced(LZ4_LIBRARY)
+-
+-if (LZ4_INCLUDE_DIR)
+-  file(STRINGS "${LZ4_INCLUDE_DIR}/lz4.h" _lz4_version_lines
+-    REGEX "#define[ \t]+LZ4_VERSION_(MAJOR|MINOR|RELEASE)")
+-  string(REGEX REPLACE ".*LZ4_VERSION_MAJOR *\([0-9]*\).*" "\\1" _lz4_version_major "${_lz4_version_lines}")
+-  string(REGEX REPLACE ".*LZ4_VERSION_MINOR *\([0-9]*\).*" "\\1" _lz4_version_minor "${_lz4_version_lines}")
+-  string(REGEX REPLACE ".*LZ4_VERSION_RELEASE *\([0-9]*\).*" "\\1" _lz4_version_release "${_lz4_version_lines}")
+-  set(LZ4_VERSION "${_lz4_version_major}.${_lz4_version_minor}.${_lz4_version_release}")
+-  unset(_lz4_version_major)
+-  unset(_lz4_version_minor)
+-  unset(_lz4_version_release)
+-  unset(_lz4_version_lines)
+-endif ()
+-
+-include(FindPackageHandleStandardArgs)
+-find_package_handle_standard_args(LZ4
+-  REQUIRED_VARS LZ4_LIBRARY LZ4_INCLUDE_DIR
+-  VERSION_VAR LZ4_VERSION)
+-
+-if (LZ4_FOUND)
+-  set(LZ4_INCLUDE_DIRS "${LZ4_INCLUDE_DIR}")
+-  set(LZ4_LIBRARIES "${LZ4_LIBRARY}")
+-
+-  if (NOT TARGET LZ4::LZ4)
+-    add_library(LZ4::LZ4 UNKNOWN IMPORTED)
+-    set_target_properties(LZ4::LZ4 PROPERTIES
+-      IMPORTED_LOCATION "${LZ4_LIBRARY}"
+-      INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIR}")
+-  endif ()
+-endif ()
+diff --git a/packaging/cmake/Modules/FindZSTD.cmake b/packaging/cmake/Modules/FindZSTD.cmake
+deleted file mode 100644
+index 7de137e0..00000000
+--- a/packaging/cmake/Modules/FindZSTD.cmake
++++ /dev/null
+@@ -1,27 +0,0 @@
+-#
+-# - Try to find Facebook zstd library
+-# This will define
+-# ZSTD_FOUND
+-# ZSTD_INCLUDE_DIR
+-# ZSTD_LIBRARY
+-#
+-
+-find_path(ZSTD_INCLUDE_DIR NAMES zstd.h)
+-
+-find_library(ZSTD_LIBRARY_DEBUG NAMES zstdd zstd_staticd)
+-find_library(ZSTD_LIBRARY_RELEASE NAMES zstd zstd_static)
+-
+-include(SelectLibraryConfigurations)
+-SELECT_LIBRARY_CONFIGURATIONS(ZSTD)
+-
+-include(FindPackageHandleStandardArgs)
+-FIND_PACKAGE_HANDLE_STANDARD_ARGS(
+-    ZSTD DEFAULT_MSG
+-    ZSTD_LIBRARY ZSTD_INCLUDE_DIR
+-)
+-
+-if (ZSTD_FOUND)
+-    message(STATUS "Found Zstd: ${ZSTD_LIBRARY}")
+-endif()
+-
+-mark_as_advanced(ZSTD_INCLUDE_DIR ZSTD_LIBRARY)
+-- 
+2.47.0
+
diff --git a/thirdparty/librdkafka/high-cpu.patch b/thirdparty/librdkafka/high-cpu.patch
deleted file mode 100644
index 78099ac86..000000000
--- a/thirdparty/librdkafka/high-cpu.patch
+++ /dev/null
@@ -1,185 +0,0 @@
-diff -rupN orig/src/rdkafka_broker.h patched/src/rdkafka_broker.h
---- orig/src/rdkafka_broker.h	2021-01-25 23:25:19.000000000 +0100
-+++ patched/src/rdkafka_broker.h	2021-02-22 16:44:21.665943600 +0100
-@@ -317,8 +317,17 @@ struct rd_kafka_broker_s { /* rd_kafka_b
-                 rd_kafka_resp_err_t err; /**< Last error code */
-                 int  cnt;                /**< Number of identical errors */
-         } rkb_last_err;
-+
-+        /** Recovery actions that need to be performed*/
-+        uint32_t rkb_recovery_actions;
- };
- 
-+/* 
-+ * Recovery actions bit flag
-+ */
-+#define RKB_RECOVERY_ACTIONS_NONE 0x0000
-+#define RKB_RECOVERY_ACTIONS_REINITIALIZE_WAKEUP_FD 0x0001
-+
- #define rd_kafka_broker_keep(rkb)   rd_refcnt_add(&(rkb)->rkb_refcnt)
- #define rd_kafka_broker_keep_fl(FUNC,LINE,RKB)  \
-         rd_refcnt_add_fl(FUNC, LINE, &(RKB)->rkb_refcnt)
-@@ -450,6 +459,7 @@ rd_kafka_broker_controller_async (rd_kaf
- 
- int rd_kafka_brokers_add0 (rd_kafka_t *rk, const char *brokerlist);
- void rd_kafka_broker_set_state (rd_kafka_broker_t *rkb, int state);
-+void rd_kafka_broker_set_recovery_action (rd_kafka_broker_t* rkbs, uint32_t action);
- 
- void rd_kafka_broker_fail (rd_kafka_broker_t *rkb,
-                            int level, rd_kafka_resp_err_t err,
-diff -rupN orig/src/rdkafka_broker.c patched/src/rdkafka_broker.c
---- orig/src/rdkafka_broker.c	2021-01-25 23:25:19.000000000 +0100
-+++ patched/src/rdkafka_broker.c	2021-02-22 16:43:33.391455200 +0100
-@@ -272,6 +272,74 @@ int16_t rd_kafka_broker_ApiVersion_suppo
-                 return maxver;
- }
- 
-+/**
-+ * @brief Setup the wake fd for IO events
-+ *
-+ * @locality broker creation or reconnection
-+ * @locks none
-+ */
-+static void rd_kafka_broker_setup_queue_wakeup_fd(rd_kafka_broker_t* rkb) {
-+    int r;
-+
-+    /*
-+     * Fd-based queue wake-ups using a non-blocking pipe.
-+     * Writes are best effort, if the socket queue is full
-+     * the write fails (silently) but this has no effect on latency
-+     * since the POLLIN flag will already have been raised for fd.
-+     */
-+    rkb->rkb_wakeup_fd[0] = -1;
-+    rkb->rkb_wakeup_fd[1] = -1;
-+    if ((r = rd_pipe_nonblocking(rkb->rkb_wakeup_fd)) == -1) {
-+        rd_rkb_log(rkb, LOG_ERR, "WAKEUPFD",
-+            "Failed to setup broker queue wake-up fds: "
-+            "%s: disabling low-latency mode",
-+            rd_strerror(r));
-+
-+    }
-+    else if (rkb->rkb_source == RD_KAFKA_INTERNAL) {
-+        /* nop: internal broker has no IO transport. */
-+
-+    }
-+    else {
-+        char onebyte = 1;
-+
-+        rd_rkb_dbg(rkb, QUEUE, "WAKEUPFD",
-+            "Enabled low-latency ops queue wake-ups");
-+        rd_kafka_q_io_event_enable(rkb->rkb_ops, rkb->rkb_wakeup_fd[1],
-+            &onebyte, sizeof(onebyte));
-+    }
-+}
-+
-+/**
-+ * @brief Set broker recovery action
-+ *
-+ * @locality any
-+ * @locks none
-+ */
-+void rd_kafka_broker_set_recovery_action(rd_kafka_broker_t* rkbs, uint32_t action) {
-+    rkbs->rkb_recovery_actions |= action;
-+}
-+
-+/**
-+ * @brief Reinitialize queue wake up fd's
-+ *
-+ * @locality any
-+ * @locks none
-+ */
-+static void rd_kafka_broker_reinitialize_wake_up_fd(rd_kafka_broker_t* rkb) {
-+    if ((rkb->rkb_recovery_actions & RKB_RECOVERY_ACTIONS_REINITIALIZE_WAKEUP_FD) != 0) {
-+        rd_rkb_log(rkb, LOG_WARNING, "WAKEUPFD",
-+            "Reinitializing the wakeup fd's");
-+
-+        if (rkb->rkb_wakeup_fd[0] != -1)
-+            rd_close(rkb->rkb_wakeup_fd[0]);
-+        if (rkb->rkb_wakeup_fd[1] != -1)
-+            rd_close(rkb->rkb_wakeup_fd[1]);
-+
-+        rd_kafka_broker_setup_queue_wakeup_fd(rkb);
-+        rkb->rkb_recovery_actions &= ~RKB_RECOVERY_ACTIONS_REINITIALIZE_WAKEUP_FD;
-+    }
-+}
- 
- /**
-  * @brief Set broker state.
-@@ -5174,6 +5242,8 @@ static int rd_kafka_broker_thread_main (
-                                 continue;
-                         }
- 
-+                        rd_kafka_broker_reinitialize_wake_up_fd(rkb);
-+
- 			/* Initiate asynchronous connection attempt.
- 			 * Only the host lookup is blocking here. */
-                         r = rd_kafka_broker_connect(rkb);
-@@ -5412,6 +5482,7 @@ rd_kafka_broker_t *rd_kafka_broker_add (
- 	rkb->rkb_proto = proto;
-         rkb->rkb_port = port;
-         rkb->rkb_origname = rd_strdup(name);
-+        rkb->rkb_recovery_actions = RKB_RECOVERY_ACTIONS_NONE;
- 
- 	mtx_init(&rkb->rkb_lock, mtx_plain);
-         mtx_init(&rkb->rkb_logname_lock, mtx_plain);
-@@ -5467,33 +5538,7 @@ rd_kafka_broker_t *rd_kafka_broker_add (
-         pthread_sigmask(SIG_SETMASK, &newset, &oldset);
- #endif
- 
--        /*
--         * Fd-based queue wake-ups using a non-blocking pipe.
--         * Writes are best effort, if the socket queue is full
--         * the write fails (silently) but this has no effect on latency
--         * since the POLLIN flag will already have been raised for fd.
--         */
--        rkb->rkb_wakeup_fd[0]     = -1;
--        rkb->rkb_wakeup_fd[1]     = -1;
--        rkb->rkb_toppar_wakeup_fd = -1;
--
--        if ((r = rd_pipe_nonblocking(rkb->rkb_wakeup_fd)) == -1) {
--                rd_rkb_log(rkb, LOG_ERR, "WAKEUPFD",
--                           "Failed to setup broker queue wake-up fds: "
--                           "%s: disabling low-latency mode",
--                           rd_strerror(r));
--
--        } else if (source == RD_KAFKA_INTERNAL) {
--                /* nop: internal broker has no IO transport. */
--
--        } else {
--                char onebyte = 1;
--
--                rd_rkb_dbg(rkb, QUEUE, "WAKEUPFD",
--                           "Enabled low-latency ops queue wake-ups");
--                rd_kafka_q_io_event_enable(rkb->rkb_ops, rkb->rkb_wakeup_fd[1],
--                                           &onebyte, sizeof(onebyte));
--        }
-+        rd_kafka_broker_setup_queue_wakeup_fd(rkb);
- 
-         /* Lock broker's lock here to synchronise state, i.e., hold off
- 	 * the broker thread until we've finalized the rkb. */
-diff -rupN orig/src/rdkafka_transport.c patched/src/rdkafka_transport.c
---- orig/src/rdkafka_transport.c	2021-01-25 23:25:19.000000000 +0100
-+++ patched/src/rdkafka_transport.c	2021-02-22 16:45:02.884392000 +0100
-@@ -987,6 +987,22 @@ int rd_kafka_transport_poll(rd_kafka_tra
- 			return 0;
- 	} else if (r == RD_SOCKET_ERROR)
- 		return -1;
-+
-+        /* In rare cases the local socket used for wake on IO could be
-+        * disconnected and this will lead the WSAPoll to return immediately
-+        * causing high CPU usage. To fix this set a broker recovery action flag
-+        * to reinitialize the local io socket while also rebuildng the transport.
-+        * Issue #3139 */
-+        if (rktrans->rktrans_pfd[1].revents & POLLERR || rktrans->rktrans_pfd[1].revents & POLLHUP) {
-+                char errstr[512];
-+                rd_snprintf(errstr, sizeof(errstr),
-+                        "Internal IO event socket disconnected for broker: %s, revents %d",
-+                        rktrans->rktrans_rkb->rkb_name, rktrans->rktrans_pfd[1].revents);
-+                rd_kafka_broker_set_recovery_action(rktrans->rktrans_rkb,
-+                        RKB_RECOVERY_ACTIONS_REINITIALIZE_WAKEUP_FD);
-+                rd_kafka_transport_connect_done(rktrans, errstr);
-+                return -1;
-+        }
- #endif
-         rd_atomic64_add(&rktrans->rktrans_rkb->rkb_c.wakeups, 1);
- 
diff --git a/win_build_vs.bat b/win_build_vs.bat
index f0699b885..b28bd3881 100644
--- a/win_build_vs.bat
+++ b/win_build_vs.bat
@@ -108,7 +108,7 @@ if [%generator%] EQU ["Ninja"] (
 )
 echo on
 cmake -G %generator% %build_platform_cmd% -DMINIFI_INCLUDE_VC_REDIST_MERGE_MODULES=%installer_merge_modules% -DTEST_CUSTOM_WEL_PROVIDER=%test_custom_wel_provider% -DENABLE_SQL=%enable_sql% -DMINIFI_USE_REAL_ODBC_TEST_DRIVER=%real_odbc% ^
-        -DCMAKE_BUILD_TYPE_INIT=%cmake_build_type% -DCMAKE_BUILD_TYPE=%cmake_build_type% -DWIN32=WIN32 -DENABLE_LIBRDKAFKA=%enable_kafka% ^
+        -DCMAKE_BUILD_TYPE_INIT=%cmake_build_type% -DCMAKE_BUILD_TYPE=%cmake_build_type% -DWIN32=WIN32 -DENABLE_KAFKA=%enable_kafka% ^
         -DENABLE_AWS=%enable_aws% -DENABLE_PDH=%enable_pdh% -DENABLE_AZURE=%enable_azure% -DENABLE_SFTP=%enable_sftp% -DENABLE_SPLUNK=%enable_splunk% -DENABLE_GCP=%enable_gcp% ^
         -DENABLE_OPENCV=%enable_opencv% -DENABLE_PROMETHEUS=%enable_prometheus% -DENABLE_ELASTICSEARCH=%enable_elastic% -DUSE_SHARED_LIBS=OFF -DENABLE_CONTROLLER=OFF  ^
         -DENABLE_BUSTACHE=%enable_bustache% -DENABLE_ENCRYPT_CONFIG=%enable_encrypt_config% -DENABLE_LUA_SCRIPTING=%enable_lua_scripting% -DENABLE_SMB=%enable_smb% ^