am-c-p-p commented on a change in pull request #741: MINIFICPP-1139 Implemented.
URL: https://github.com/apache/nifi-minifi-cpp/pull/741#discussion_r385564172
##########
File path: extensions/windows-event-log/ConsumeWindowsEventLog.cpp
##########
@@ -248,21 +239,38 @@ void ConsumeWindowsEventLog::onSchedule(const
std::shared_ptr<core::ProcessConte
}
}
- if (subscriptionHandle_) {
- logger_->log_error("Processor already subscribed to Event Log, expected
cleanup to unsubscribe.");
- } else {
- sessionFactory_ = sessionFactory;
+ context->getProperty(Channel.getName(), channel_);
+ wstrChannel_ = std::wstring(channel_.begin(), channel_.end());
- subscribe(context);
+ std::string query;
+ context->getProperty(Query.getName(), query);
+ wstrQuery_ = std::wstring(query.begin(), query.end());
+
+ if (!pBookmark_) {
+ std::string bookmarkDir;
+ context->getProperty(BookmarkRootDirectory.getName(), bookmarkDir);
+ if (bookmarkDir.empty()) {
+ logger_->log_error("State Directory is empty");
+ return;
+ }
+ pBookmark_ = std::make_unique<Bookmark>(wstrChannel_, wstrQuery_,
bookmarkDir, getUUIDStr(), logger_);
+ if (!*pBookmark_) {
+ pBookmark_.reset();
+ return;
+ }
}
+
+ context->getProperty(MaxBufferSize.getName(), maxBufferSize_);
+ logger_->log_debug("ConsumeWindowsEventLog: maxBufferSize_ %lld",
maxBufferSize_);
Review comment:
Fixed.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services