fgerlits commented on code in PR #1885:
URL: https://github.com/apache/nifi-minifi-cpp/pull/1885#discussion_r1816594359


##########
extensions/kafka/ConsumeKafka.h:
##########
@@ -219,9 +217,13 @@ class ConsumeKafka : public KafkaProcessorBase {
 
   ADD_COMMON_VIRTUAL_FUNCTIONS_FOR_PROCESSORS
 
-  explicit ConsumeKafka(std::string_view name, const utils::Identifier& uuid = 
utils::Identifier()) :
+  explicit ConsumeKafka(const std::string_view name, const utils::Identifier& 
uuid = utils::Identifier()) :

Review Comment:
   I don't think we should add `const` here; `name` is passed by value, and 
`const` may prevent moving. `string_view` is cheap to copy, so it's not a real 
issue, but in general, we shouldn't make by-value parameters `const` (in the 
header/interface).



##########
extensions/kafka/PublishKafka.h:
##########
@@ -0,0 +1,234 @@
+/**
+ * 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 };

Review Comment:
   Please update `PROCESSORS.md`, as the allowed values of the `CompressCodec` 
property have changed.



##########
extensions/kafka/PublishKafka.cpp:
##########
@@ -376,10 +326,9 @@ 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)) {

Review Comment:
   We used to reject empty property values here, but we no longer do (also at a 
few other places further down).  Is this intentional?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to