Take look at other processors that use AtomicXXXXX for such things ( like
the relationships), as here
https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/DistributeLoad.java




On December 8, 2019 at 20:41:28, Joe Witt ([email protected]) wrote:

Phil

You can have a class member variable and just protect access to it. This
is quite common in many processors.

Thanks

On Sun, Dec 8, 2019 at 7:30 PM Phil H <[email protected]> wrote:

> Hi there,
>
> I have a custom processor that I want to contain some shared data across
> threads (this data is based on analysis of flow files, so constantly
> changing). I can’t use a static variable though, because I use the same
> processor more than once within my flow in different contexts. If there
> isn’t a “proper” way to do this in the NiFi API, is there a way to
> programmatically access the componentID (as shown in the UI) so I could
use
> that as a key to a Map containing the data?
>
> Thanks,
> Phil
>

Reply via email to