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:50 UTC

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

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% ^