nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Payne <>
Subject Re: clear all flowfiles in all queues upon NiFi restart
Date Fri, 12 Jan 2018 03:49:43 GMT

I have to admit - that’s kind of an odd request :) I’m curious what the use case is, if
you can share?

Regardless, the easiest way would be to update so that the FlowFile repo that
is used is the VolatileFlowFileRepository. This would avoid writing the FlowFile state to
disk, so ok restart you will lose all FlowFiles. The content will still be present, but nifi
will delete it all on startup because there is no FlowFile associated with it.

I’m on my phone right now so can’t easily tell you the exact name of the property to change
but you’ll probably find it pretty quickly. The Admin Guide may well explain the different
repositories as well. 


Sent from my iPhone

> On Jan 11, 2018, at 10:31 PM, 尹文才 <> wrote:
> Hi guys, I'm trying to clear all FlowFIles in all queues when NiFi is
> restarted, but I don't know the correct way to do this. I checked all
> NiFi's guide documentation,
> it seems there're 2 possible solutions:
> 1. write a custom notification service: a notification service could be
> notified when NiFi is restarted and then inside the service, delete all the
> files inside content_repository, flowfile_repository and
> provenance_repository.
>   I know there're now 2 existing services: email and http. But I'm not
> quite sure how to correctly write one and deploy it into my NiFi
> environment, is there a tutorial on writing one notification service?
> 2. I know from the developer guide that by using the annotation @Shutdown
> in a custom processor, the method could be called when NiFi is successfully
> shut down. The problem with this approach is the method could
>   not be guaranteed to be called when NiFi dies unexpectedly.
> Does anyone know what is the correct way to implement it? Thanks.
> Regards,
> Ben
View raw message