Created 11-21-2015 11:27 PM
What is the best way to execute a one-time action during a NiFi startup? E.g. call home and report the (floating) IP address of the instance, or update a registry, etc.
Contrary to a reporting task, the idea is to fire once, not be running continuously while NiFi is up and have no requirement to be configured by a user explicitly (other than an admin deploying the code).
Created 11-22-2015 01:53 PM
NiFi supports the notion of Bootstrap Notification Services. These services can be configured to run when NiFi is Started, when NiFi is stopped, or when NiFi unexpected dies (or any combination of those). Currently, the only implementation that exists is the E-Mail Notification Service, but others could certainly be developed. These are configured in the conf/bootstrap.conf file and associated conf/boostrap-notification-services.xml file.
Created 11-22-2015 01:53 PM
NiFi supports the notion of Bootstrap Notification Services. These services can be configured to run when NiFi is Started, when NiFi is stopped, or when NiFi unexpected dies (or any combination of those). Currently, the only implementation that exists is the E-Mail Notification Service, but others could certainly be developed. These are configured in the conf/bootstrap.conf file and associated conf/boostrap-notification-services.xml file.
Created 11-22-2015 11:37 PM
Thanks @mpayne , this worked quite well for Started and Stopped events. I had a question on DIED notification, however. What logic does it use to detect this event? E.g. if I killed a child NiFi process, the bootstrap log simply has 'NiFi never started entry added', whereas I expected something else.
Created 11-23-2015 01:08 AM
When you start NiFi, the bootstrap process is constantly monitoring the NiFi process. If it notices that the NiFi process doesn't exist anymore, it will produce a NIFI_DIED notification and then restart NiFi.