arpadboda commented on a change in pull request #648: WIP: Minificpp 1025 -- 
add metadata
URL: https://github.com/apache/nifi-minifi-cpp/pull/648#discussion_r329126342
 
 

 ##########
 File path: extensions/windows-event-log/ConsumeWindowsEventLog.cpp
 ##########
 @@ -329,7 +404,14 @@ int ConsumeWindowsEventLog::processQueue(const 
std::shared_ptr<core::ProcessSess
     session->putAttribute(flowFile, FlowAttributeKey(MIME_TYPE), 
"application/xml");
     session->getProvenanceReporter()->receive(flowFile, provenanceUri_, 
getUUIDStr(), "Consume windows event logs", 0);
     session->transfer(flowFile, Success);
-    session->commit();
+
+       flowFile = session->create();
+
+       session->write(flowFile, &WriteCallback(evt.rendered_text_));
+       session->putAttribute(flowFile, FlowAttributeKey(MIME_TYPE), 
"text/plain");
+       session->getProvenanceReporter()->receive(flowFile, provenanceUri_, 
getUUIDStr(), "Consume windows event logs", 0);
+       session->transfer(flowFile, Success);
 
 Review comment:
   I think producing two different flowfiles and transferring them to the same 
relationship is far from ideal. 
   First it requires an additional processor to separate them, but also 
produces two flowfiles from one event. As the user most probably needs one or 
the other, this results in a lot of needless IO ops (writing flowfiles to 
content repo) and filling the disk without any value added. 
   To resolve I would either:
   
   - create two different relationships (text and xml) and route them 
accordingly. Not the best as it solves only one part of the issue. 
   - introduce a processor property called "mode" or sg alike, which can be set 
to "text", "xml" or "both". This would support the current behaviour as well, 
and it case the user selects this, his is free to split them using 
routeonattribute, but at least we don't force that. 
   
   As this processor is not released yet, we don't break anything. I would 
really appreciate to put more effort in this now and avoid being limited by 
backward compatibility later. 
   @bakaid @am-c-p-p @phrocker @apiri - please don't hesitate to share your 
opinion!

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

Reply via email to