After doing my best to find previous questions and examples relevant to this question, and still not finding the answers that I'm looking for I figured that I would submit a question myself.
ExecuteStreamCommand seems like the perfect processor for me due to the following reasons:
In a nutshell, what I'm trying to do with ExecuteStreamCommand is:
python3 my_script.py
)For clarity's sake I currently don't understand:
I have come across various examples for ExecuteScript, but unfortunately these don't exactly translate to the use of the ExecuteStreamCommand.
Thank you in advance. Any advice is appreciated.
From your question you say you need to invoke the Python script without using the InvokeScriptedProcessor
or ExecuteScript
processors because you can't use Jython. Given that requirement, you should still be able to accomplish your goal. While it requires some familiarity with the framework, all of this information is from the ExecuteStreamCommand
documentation.
Your "I currently don't understand" section:
How to call the python script (from the ExecuteStreamCommand Processor)
In your ExecuteStreamCommand
processor, configure the Command Arguments and Command Path properties with the following:
any flags or args, delimited by ;
(i.e. /path/to/my_script.py
)/path/to/python3
How to load up the FlowFile from within Python
ExecuteStreamCommand
processor. Your script does not need to have any awareness of "flowfiles" in this instance. If you were instead using the ISP
or ES
processors, you could use the NiFi scripting API which is automatically injected into the scripts to create or update the flowfile object. 0
) NiFi will generate a new flowfile with that content. If you set the Output Destination Attribute property of ESC
to a non-null value, NiFi will instead update the existing flowfile with a new attribute of the same name containing the output of the script.