Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

NiFi automated deployment and InvokeScriptedProcessor reload

NiFi automated deployment and InvokeScriptedProcessor reload

New Contributor

In demo.zip, there is a demo-flow.json which is to be deployed to a NiFi server using Automate workflow deployment in Apache NiFi with the NiFi Registry approach. This flow contains these variables:

"variables": {
    "es.file": "/tmp/demo_execute_script.groovy", 
    "isp.file": "/tmp/demo_invoke_scripted_processor.groovy"
}

After automated deployment to a NiFi server, the variables value may change, for example:

93343-screenshot-21-11-2018-7-34-31-pm.png

However, InvokeScriptedProcessor still refers to the old variable value unexpectedly, meanwhile ExecuteScript understands the new variable value, and loads the script successfully:

93342-screenshot-21-11-2018-7-33-17-pm.png

How to reload InvokeScriptedProcessor with automated deployment?

5 REPLIES 5

Re: NiFi automated deployment and InvokeScriptedProcessor reload

Hey. Are you sure you have deployed the correct version of your Groovy script on the NiFi node(s)? It looks like the Groovy is not correct. (I checked the one you provided and looks good to me though)

Re: NiFi automated deployment and InvokeScriptedProcessor reload

New Contributor

I'm sure that the Groovy scripts have been deployed to the target NiFi node. In the example, the variable value changed from /tmp/ directory to C:/tmp/demo/ directory after deployment. ExecuteScript (ES) could refer to the script at the new directory, but InvokeScriptedProcessor (ISP) still refers to the script at the old directory.

Workaround to solve this is: I manually change ISP properties to point to another path, and then change it back to point to the correct path. Thus triggering ISP reload. Of course I can't do manual ISP reload in production environment.

Highlighted

Re: NiFi automated deployment and InvokeScriptedProcessor reload

Not sure to understand the process you're following. Are you using the NiFi Registry? If yes, then when deploying a registered flow, it'll use the variables as defined when you committed the version in the Registry. After the import, in the target NiFi, you'd have to update the variables with the values of the target environment. Makes sense?

Re: NiFi automated deployment and InvokeScriptedProcessor reload

New Contributor

Yes, I'm using NiFi Registry. After import, I've updated the variables with the values of the target environment as expected. And InvokeScriptedProcessor (ISP) still refers to the variable value as defined when I committed the version in the Registry instead of the values of the target environment.

Re: NiFi automated deployment and InvokeScriptedProcessor reload

New Contributor

To reproduce issue easily, I have added es-isp.zip, which now contains auto deployment with NiPyAPI.

Question: How to reload InvokeScriptedProcessor (ISP) so that it could refer to the variable values of the target environment instead of the old variable value defined when it is committed into the Registry?