Sometimes you may need to remove a specific FLowFile from a queue that causes specific issue, such as NIFI-3040. With that particular issue, RouteOnAttribute
can't be used because the processor will try to generate provenance event, but the FlowFile doesn't have required attribute to do so.
In that case, ExecuteScript
can route FlowFiles silently..
Stop the destination Processor then insert a ExecuteScript
processor taking the relationship as shown below:
Then use this script to filter out FlowFiles causing the issue:
def flowFile = session.get()
if(!flowFile) return
if(flowFile.getAttribute("uuid")) {
session.transfer(flowFile, REL_SUCCESS)
return
}
session.transfer(flowFile, REL_FAILURE)