Support Questions

Find answers, ask questions, and share your expertise
Celebrating as our community reaches 100,000 members! Thank you!

NiFi - Using existing controller service in a custom processor


Hi Team,


I have template running in production. This template has some controller services enabled. I also have some custom processors as part of the template. My requirement is to update the custom processor to include an existing controller service to it. I am able to achieve this requirement, but I have to go and manually select the controller service in the custom processor in order to use it. Below is an example,


First it will show as below
Hive Database Connection Pooling Service -> Incompatible Controller Service Configured.

I have to manually go & select controller service from drop down to use ,
Hive Database Connection Pooling Service -> HiveConnectionPool


Hence I wanted to know if there any mechanism by which I will be able to pass the controller service name by default from the custom processor, so that it can automatically use it, instead of manual intervention?





@ravisro   This is a great question.  I would love to see some of the NiFi pros here respond.  However, you may only find a better response on NiFI Mailing list or ApacheNiFi slack: link for slack channel here)


In the meantime, one of the ways i have accomplished this in the past, is documenting the root level Controller Service Ids for each environment (DEV,STAGING,PROD) and swapping these into the template before importing the template to the environment.   It's a clunky solution, but it works.   I have used this since before NiFi Registry.  With Registry in the mix,  I am forced to use the NiFI API to update the flows to appropriate controller service.  Again clunky, which is why I would love to hear more comments from other community members.


If this answer resolves your issue or allows you to move forward, please choose to ACCEPT this solution and close this topic. If you have further dialogue on this topic please comment here or feel free to private message me. If you have new questions related to your Use Case please create separate topic and feel free to tag me in your post.





@stevenmatison Thanks for your reply!


In my use case, I will not be updating/uploading any nifi templates. I will be only updating my custom processor to include a controller service(which is already present as part of the existing template at the root level) and deploy the NAR. I need to find a way to pass this controller service name to the custom processor as a default value, so that after the NAR deployment, already existing templates automatically picks the controller services without any need to modify the existing templates to include the controller services. Is it possible to do it?


Thanks & Regards,



@ravisro  I think the only way you can do this is to make a custom process that interacts with the NiFI Api to complete your actions.   If you use the NiFI UI,  with developer tools open,  you can watch/record all of the api calls the UI uses against the api to perform the action manually.  Next, duplicate the required actions in your processor.    


I would love to see you post this same question in the NiFi Slack...