A faster way to develop and test your new Nifi processor
I am developing a new Nifi processor for data flow. I am making code changes in eclipse, creates a new .nar file and copy it to the Nifi lib to test it.
Any Nifi update requires a reboot which takes a significant amount of time.
Is there a better way to test your new .nar in Nifi? Because restarting Nifi for every small change will reduce development speed.
source to share
There are several rapid prototyping and testing options available to simplify the development of Apache NiFi processors.
- Model your code in
ExecuteScript
- with a processor,ExecuteScript
you can make code changes to your domain code (no matter what you enter into the processor propertyScript Body
or the referenced fileScript File
) without having to create anything or restart your application. You can play the same stream files through the updated code using the NiFi Script Tester feature . Once you have acceptable behavior, return the Script body and move it to a custom processor that you can deploy. - Use NiFi Unit and Integration Testing - Test harnesses and runners provided by the base framework will allow you to simulate flow scenarios in automated tests before deploying the entire application. It takes a little time to create the first thread, but once you do, it is a repeatable and straightforward process that you can use to cover edge cases and provide the desired behavior.
source to share
Just check how testing is done for standard nifi processors. And do the same. For example take a look at dbcp https://github.com/apache/nifi/tree/master/nifi-nar-bundles/nifi-standard-services/nifi-dbcp-service-bundle/nifi-dbcp-service/src
You don't need to start nifi for these tests.
source to share