How to turn off Nifi Processor Schedule

2019-07-07 01:50发布

问题:

I have GetHttp and InvokeHttp Nifi processors which initiates flows in Nifi, but I want them to get from the URLs only once and pass the data to the next process With processor configurations I am unable to turn off scheduling, how to achieve this.

回答1:

InvokeHttp could be not initial and could be triggered by incoming flow file from other processor.

So, you can put kind of sync logic before and after your InvokeHTTP processor.

For example you can use Wait/Notify processors.



回答2:

Apache NiFi processors and flows are designed for constant data streams rather than single "job executions" or "batch processing". A metaphor we use often is that rather than building and fitting pipes to run water through, NiFi helps you dig irrigation ditches along an already-flowing river. The data is already there (and moving) all the time.

If this is truly a one-time action you need to trigger, you can set the Run Schedule to something like 30 sec and manually Start and then Stop those processors. They will execute once, and as long as you stop them within 30 seconds, not execute again.

If this isn't something you can do manually, you can set the Run Schedule to something like 52 weeks. You can also change the Scheduling Strategy to CRON driven and set the Run Schedule to a crontab parameter with a very long schedule.

As @daggett noted, you can also use the Wait/Notify processors to trigger a flow which otherwise would not execute, but this only works for InvokeHTTP, as GetHTTP is a source processor.



标签: apache-nifi