1
votes

I'm trying to copy data from a database and place it in S3 using nifi. I'm able to copy the data from database and place it in S3. Now I'm trying to add error handling for this flow. I just added the PutEmail processor for error notification. I just gave a wrong bucket name to validate the Email. This PutEmail processor is getting triggered for each and every flow file(As there are 100 flow files mail is triggering 100 times). I just want to trigger this PutEmail(notification) only once whenever there is a error in the flow. Any suggestions on this please.

Below is the Flow:

enter image description here

Any suggestions on better(Generic) error handling will be helpful for me.

2

2 Answers

5
votes

For your use case, MergeContent would allow you to batch several FlowFiles over a given duration to be rolled up into a singular email.

You could additionally do some additional transforms to only get the key parts of the content and/or attributes to provide source FlowFiles to MergeContent that would give a summary listing in the message sent.

0
votes

You can implement custom ReportingTasks which will periodically sends reports based on Need