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

[nifi-minifi-cpp] 01/03: MINIFICPP-1824 Remove custom validator from ListenSyslog Closes #1327

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

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

commit be1878175f935243fcb60261694a8337408bcf1c
Author: Martin Zink <ma...@apache.org>
AuthorDate: Fri May 6 08:56:23 2022 +0200

    MINIFICPP-1824 Remove custom validator from ListenSyslog
    Closes #1327
    
    Signed-off-by: Adam Markovics <nu...@gmail.com>
---
 extensions/standard-processors/processors/ListenSyslog.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/extensions/standard-processors/processors/ListenSyslog.cpp b/extensions/standard-processors/processors/ListenSyslog.cpp
index 61316b25c..95b9c1327 100644
--- a/extensions/standard-processors/processors/ListenSyslog.cpp
+++ b/extensions/standard-processors/processors/ListenSyslog.cpp
@@ -40,7 +40,7 @@ const core::Property ListenSyslog::ProtocolProperty(
 const core::Property ListenSyslog::MaxBatchSize(
     core::PropertyBuilder::createProperty("Max Batch Size")
         ->withDescription("The maximum number of Syslog events to process at a time.")
-        ->withDefaultValue<uint64_t>(500, std::make_shared<core::UnsignedLongValidator>("Greater or equal than 1 validator", 1))
+        ->withDefaultValue<uint64_t>(500)
         ->build());
 
 const core::Property ListenSyslog::ParseMessages(
@@ -86,6 +86,9 @@ void ListenSyslog::onSchedule(const std::shared_ptr<core::ProcessContext>& conte
   gsl_Expects(context && !server_thread_.joinable() && !server_);
 
   context->getProperty(MaxBatchSize.getName(), max_batch_size_);
+  if (max_batch_size_ < 1)
+    throw Exception(PROCESS_SCHEDULE_EXCEPTION, "Max Batch Size property is invalid");
+
   context->getProperty(ParseMessages.getName(), parse_messages_);
 
   uint64_t max_queue_size = 0;