nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Russell Bateman <r...@windofkeltia.com>
Subject Re: Static processor design
Date Fri, 08 Jan 2021 15:33:57 GMT
The code I really want to run is sitting in onTrigger(), though I could 
move it elsewhere.

Yes, I have tried

*Scheduling Strategy*of Timer driven
*Run Schedule*of 10 sec

...but the getLogger().info( "called from onTrigger()" )never reaches 
/logs/nifi-app.log/ (while the logging statement from 
onPropertyModified()does reach the log every time I change properties to 
remove old or introduce new properties).


On 1/7/21 6:38 PM, Russell Bateman wrote:
> (Inadequate title; didn't know what to call it.)
>
> I have written a processor that doesn't feature any relationships.
>
> It accepts dynamically properties that, in theory, when created (or 
> removed, or values added or changed), and sets data into a class 
> inside my NAR.
>
> I wonder, however, at what I expect of it because, while it works in 
> unit testing, it does not in practice. I can sort of guess why, but 
> I'm not sure what to do about it. Given that I can create methods to 
> be called at various opportunities by annotating thus:
>
>     @OnAdded
>     @OnEnabled
>     @OnRemoved
>     @OnScheduled
>     @OnUnscheduled
>     @OnStopped
>     @OnShutdown
>
> There isn't one of these annotations that says to my brain, "When a 
> dynamic property is added, changed or removed, wake up and run this 
> method." Except, of course, for onPropertyModified(). A new property 
> is duly added when created in configuration; my call to 
> getLogger.info()from onPropertyModified()shows
>
> 2021-01-07 18:32:51,923 INFO [NiFi Web Server-78] 
> c.windofkeltia.processor.HumanReadables 
> HumanReadables[id=afa5b637-0176-1000-78bd-a74904054649] null -> 
> |http://hospital.smarthealthit.org|Smart Health IT
>
> But, how do I incite some code after the fact to awaken and analyze 
> the newly added configuration then affect the 
> HumanReadableMappingsclass instance?
>
> (Hope I haven't explained this too badly. I am willing to attach 
> code--it's a very tiny processor.)
>
> Thanks
>
>
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message