arpadboda commented on a change in pull request #712: MINIFICPP-1047 Add
property "Drop empty flow files" to PublishKafka
URL: https://github.com/apache/nifi-minifi-cpp/pull/712#discussion_r368575021
##########
File path: extensions/librdkafka/PublishKafka.cpp
##########
@@ -639,6 +647,17 @@ void PublishKafka::onTrigger(const
std::shared_ptr<core::ProcessContext> &contex
PublishKafka::ReadCallback callback(max_flow_seg_size, kafkaKey,
thisTopic->getTopic(), conn->getConnection(), flowFile,
attributeNameRegex, messages,
flow_file_index);
session->read(flowFile, &callback);
+
+ bool dropEmptyFlowFiles;
+ if (!callback.called_ &&
context->getProperty(DropEmptyFlowFiles.getName(), dropEmptyFlowFiles) &&
!dropEmptyFlowFiles) {
Review comment:
How does it solve the original issue?
In case session->read fails due to missing content claim, it swallows
exception, so the execution continues but the callback is never called?
What's the motivation of moving the kafka related logic to the callback?
I also have a feeling that this solution won't work in the there IS a
content claim, but the content is actually empty.
Because of this I don't think that moving the logic to the callback is a
good idea.
----------------------------------------------------------------
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