Created 09-05-2022 12:34 AM
Hello all,
I'm working with a custom processor, and among other things, I added to the init() method two things : I register an MBean and I start a new thread.
When testing I noticed that I got 2 MBeans registered and 2 threads created. When digging a bit further, I saw that one MBean and one thread were linked to a processor whose id was "mock-processor", and when looking at Nifi's source code it looks like this is part of the initialization of all processors (https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nif...), but I'm not sure, and I didn't find anything about that in the documentation.
I have two questions:
Cheers!
Created 09-13-2022 02:10 AM
After further testing, it looks like this only happens when the first processor instance of a given type is added to the canvas. When adding another instance, only 1 thread starts and 1 MBean is registered. However, even after deleting all instances, the mock processor is not removed, so the associated MBean and thread remain. That is not really problematic, but if anyone knows why Nifi works that way, I'd be interested to know.