nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Payne <marka...@hotmail.com>
Subject RE: Threading in a NiFi Processor
Date Thu, 13 Aug 2015 18:38:36 GMT
Ryan,

The down side to that approach is that you're tying up that thread from the thread pool when
you call sleep.

Typically, in a situation like this, where you want to 'pause' processing for a bit, you would
call ProcessContext.yield() and then return. 
This causes the framework not to trigger that processor for some period of time (configurable
in the Settings tab, default is 1 sec).

Does this work for you?

Thanks
-Mark


----------------------------------------
> Date: Thu, 13 Aug 2015 14:19:36 -0400
> Subject: Threading in a NiFi Processor
> From: rhendrickson.work@gmail.com
> To: dev@nifi.apache.org
>
> I have always stayed away from doing any threading inside a NiFi processor.
>
> However, I recently came across a use-case where I'm calling a web service
> from within a custom Nifi Processor and I don't want to overwhelm the web
> service.
>
> I'd like to instrument a sleep in the onTrigger() or process() method of
> about 1 second, or a configurable amount.
>
> Is there a pattern established for Nifi Processors to accomplish this
> nicely?
>
> Thanks,
> Ryan
 		 	   		  
Mime
View raw message