As anyone aware of a solution to restart within a NiFi flow or the UI? I do not see any options available through the UI. I've tried using the stream command processor but it does not disown the commands.
I am trying to understand the use case where you would want to restart NiFi from within your dataflow? Can you provide more detail on what you are trying to accomplish? The NIFi UI does not provide a means for executing a NiFi start, stop or restart.
When a custom processor is added to a cloud directory we pull the file and place in processor directory, which requires a restart. I’m aware I could look for another solution that doesn’t rely on NiFi itself for this use case but our current deployment setup makes this easy (except the restart).
I can't think of a way to accomplish this. The issue you run into is the that NiFi processors in general need to complete their task before committing the FlowFile that triggered that task to the success relationship. What you are trying to do is use the ExecuteStreamCommand or even ExecuteScript to trigger a NiFi restart. The problem is NiFi is restarted before the command or script can return, so the FlowFile task never completes and gets committed to success relationship. So when NiFi did restart, it would try to reprocess that FlowFile. I fear you would trigger a non stop restart scenario.
As far as the NiFi API goes, Anything you can do via the UI, you can do via direct class to to the rest-api. The rest-api does not provide a means to restarting the NiFi application.
What i think you need here is a process totally outside of NiFi that monitors for your new nars, moves them to your custom NiFi lib directory and triggers a NiFi restart.