Support Questions
Find answers, ask questions, and share your expertise

Through java how to i stop the processor? when ever the exception is there automatically stop the processor?

Explorer
 
4 REPLIES 4

@viswanatha reddy you can exit from java process anytime while using system.exit(),try with system.exit(0) while doing exception handling.

Master Guru

@viswanatha reddy Can you provide a little more detail as far as what you are trying to do? Are asking if there is a way to stop a processor if it throws an exception (A particular exception?)? Can you give an example?

New Contributor

@Matt Clarke : Even I am having the similar question. How can we programmatically Stop or shutdown the custom processors under exceptions or logger.error?

Expert Contributor

@viswanatha reddy, @Akshata Nilekani,

there is a discussion about stopping processors using nifi apis:

https://community.hortonworks.com/questions/67900/startstop-processor-via-nifi-api.html

Now, if you have custom processor, I believe you could define class member to flag when you want to stop processing incoming flow files onTrigger, then define relationship to processor InvokeHTTP, and call nifi API as mentioned by a link above (and whatever notifications you need, as usually).

If you use built-in processor, you won't be able to immediately prevent a processor of processing incoming flow files (queued or just rapidly coming in), but still you can forward failed FF to failure relationship and call InvokeHTTP processor and the rest of your error handling.