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.

Can global variable be set dynamically in NIFI processorGroup

Can global variable be set dynamically in NIFI processorGroup

New Contributor

I am new to Nifi, I am trying to create a process group which takes an authentication token using get port and makes call to Api. I have used Httpprocessor to fetch the data, after fetching the data I am taking some data, let's say an I'd using EvaluateJSONPath and passing it to a new hero processor to fetch some other data. But I am not able to pass the token that I received at the very start of the process group. Is there any way I can set the token received global for all process in processorgroup ?? We can set a global variable for processorGroup but can it's value be made dynamic instead of static ??

1 REPLY 1
Highlighted

Re: Can global variable be set dynamically in NIFI processorGroup

Master Guru

@Raj Negi
The Process Group variables are not dynamic. Anytime the variable is changed it requires a restart of any component that references it. That is because those components read in that variable value when they are started in a lot of cases.

-

Your first dataflow is responsible executing an InvokeHTTP processor to retrieve the token needed for all the different dataflows within the same Process Group. You may consider adding a PutDistributedMapCache processor in that flow to write that retrieved token out to a cache server. In each of your other dataflows you could have a FetchDistributedMapCache processor that pulls that token from the cache server so it is is added to every FlowFile.

-

Thank you,

Matt

-

If you found this answer addressed your question, please take a moment to login in and click the "ACCEPT" link.