There is no inbuilt error notification system in NiFi. We need to notify with an email when any processor in the process group fails. It should also contain the cause of error and location of process group
Failure relationships (such as not found, comms failure, etc) from all processors are to be connected to one Error Handling Process Group. The process group will read the nifi bulletin to fetch error records and send them in a mail.
Replace entire content of flowfile with username and password from variables.
Gets access token using nifi rest api and put it in a flow file attribute.
Fetches data from nifi bulletin using the access token
- Bulletin contains warning, debugs, errors etc and holds the elements for 5 minutes
- JOLT Filters ERROR elements in the array and fetches the latest element.
Evaluate Json Path
- Reads Processor and Process group Id from the bulletin content and adds them as flow file attribute
- Attaches the flow file containing cause of error with the email
- Creates a message body containing “Source of Error - url” using Processor ID and Process Group attributes.
- Send the notification Email
Process Group xml - Error Handling Process Group