Skip to main content
Joe685
Silver ⭐️⭐️
September 8, 2021
Solved

NIFI: Process 1 flowfile every x seconds, ignore/delete other flow files

Hi, 

we have a large number of flowfiles received and processed via NiFi.  Post the NiFi processing we then perform/send the data on via http request. The issue we have at the moment, is that the application (externally to NiFi) can not consume the data fast enough when received from NiFi. What I am looking for is, an ability to only take 1 flowfile every 5 seconds and everything in-between delete/remove.  

 

Have looked at 1 processor that allows for a per flowfile process, however data then starts getting stuck in the queue.  So although processing 1 file every 5 seconds works, its the delete/remove of any other flow files that I need.  

Thanks.

bbahamondes
Gold ⭐️
September 8, 2021

Hi Joe, You could use ControlRate to set the max number of flowfiles per second/minute that needs to be routed.

 

bbahamondes_0-1631117992502.png

In order to periodically clean the incoming queue you can set a Flowfile Expiration on the incoming connection.

Connection config:

bbahamondes_1-1631118039162.png

ControlRate config:

bbahamondes_2-1631118066672.png

 

With this, flowfiles on the connection will be cleared after they've been for more than 30 seconds on the queue. 

2 replies

bbahamondes
Gold ⭐️
Gold ⭐️
September 8, 2021

Hi Joe, You could use ControlRate to set the max number of flowfiles per second/minute that needs to be routed.

 

bbahamondes_0-1631117992502.png

In order to periodically clean the incoming queue you can set a Flowfile Expiration on the incoming connection.

Connection config:

bbahamondes_1-1631118039162.png

ControlRate config:

bbahamondes_2-1631118066672.png

 

With this, flowfiles on the connection will be cleared after they've been for more than 30 seconds on the queue. 

Translate
Joe685
Joe685Author
Silver ⭐️⭐️
September 9, 2021

Thanks for this, I completely mis-understood this processor.  I read it and thought it was only a control out eg. continue to consume, but only send 1 at a time.  Looks like, this is a one in and one out at a time... looks like this will sort out what I need.  Thanks

Translate