You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@nifi.apache.org by "Peter Wicks (pwicks)" <pw...@micron.com> on 2018/10/15 20:10:41 UTC

Delay a FlowFile for a specific amount of time

A coworker and I were working on a problem where we needed to delay a group of FlowFile's for 60 minutes. Our first attempt of course used ControlRate, but with ControlRate the first file is let through immediately, and only after that are the rest of the files delayed.

We got it working by using FlowFile penalization on a broken PutFile processor to penalize all files for 60 minutes, and all files fail due to the bad config. In testing this looks good, but... well it's pretty ugly. Is there an easy fix for this? My first thought was we need a "Delay" processor.

--Peter

Re: Delay a FlowFile for a specific amount of time

Posted by Pierre Villard <pi...@gmail.com>.
Hey Peter,

What about ExecuteScript with few Groovy lines?

flowFile = session.get()
if(!flowFile) return
session.penalize(flowFile)
session.transfer(flowFile, REL_SUCCESS)

Pierre



Le lun. 15 oct. 2018 à 22:10, Peter Wicks (pwicks) <pw...@micron.com> a
écrit :

> A coworker and I were working on a problem where we needed to delay a
> group of FlowFile’s for 60 minutes. Our first attempt of course used
> ControlRate, but with ControlRate the first file is let through
> immediately, and only after that are the rest of the files delayed.
>
>
>
> We got it working by using FlowFile penalization on a broken PutFile
> processor to penalize all files for 60 minutes, and all files fail due to
> the bad config. In testing this looks good, but… well it’s pretty ugly. Is
> there an easy fix for this? My first thought was we need a “Delay”
> processor.
>
>
>
> --Peter
>

RE: [EXT] Re: Delay a FlowFile for a specific amount of time

Posted by "Peter Wicks (pwicks)" <pw...@micron.com>.
Bryan/Pierre, both good ideas. Thanks for the input!

-----Original Message-----
From: Bryan Bende [mailto:bbende@gmail.com] 
Sent: Monday, October 15, 2018 2:14 PM
To: users@nifi.apache.org
Subject: [EXT] Re: Delay a FlowFile for a specific amount of time

Maybe a Wait processor with an expiration of 60 mins? If you never use a Notify processor then its basically just going to wait til the expiration.
On Mon, Oct 15, 2018 at 4:10 PM Peter Wicks (pwicks) <pw...@micron.com> wrote:
>
> A coworker and I were working on a problem where we needed to delay a group of FlowFile’s for 60 minutes. Our first attempt of course used ControlRate, but with ControlRate the first file is let through immediately, and only after that are the rest of the files delayed.
>
>
>
> We got it working by using FlowFile penalization on a broken PutFile processor to penalize all files for 60 minutes, and all files fail due to the bad config. In testing this looks good, but… well it’s pretty ugly. Is there an easy fix for this? My first thought was we need a “Delay” processor.
>
>
>
> --Peter

Re: Delay a FlowFile for a specific amount of time

Posted by Bryan Bende <bb...@gmail.com>.
Maybe a Wait processor with an expiration of 60 mins? If you never use
a Notify processor then its basically just going to wait til the
expiration.
On Mon, Oct 15, 2018 at 4:10 PM Peter Wicks (pwicks) <pw...@micron.com> wrote:
>
> A coworker and I were working on a problem where we needed to delay a group of FlowFile’s for 60 minutes. Our first attempt of course used ControlRate, but with ControlRate the first file is let through immediately, and only after that are the rest of the files delayed.
>
>
>
> We got it working by using FlowFile penalization on a broken PutFile processor to penalize all files for 60 minutes, and all files fail due to the bad config. In testing this looks good, but… well it’s pretty ugly. Is there an easy fix for this? My first thought was we need a “Delay” processor.
>
>
>
> --Peter