Created 04-11-2018 09:19 AM
I've created NiFi variables for broker uri, MQ Client Libraries path and MQ ConnectionFactory Implementation, and have set values for each variables(Variable names are broker_uri,client_libs,con_factory ). I could also see that my variables can detect the Referencing Controller service but variable's values are not getting populated in place of variable name, because of that status of controller service is invalid and after Hover to invalid icon it's showing me "broker uri can't be blank: ${boker_uri} " instead of variable values it's showing variable name like ${broker_uri}.
Thanks,
Created 04-11-2018 12:39 PM
Where have the key/value pairs for broker_uri,client_libs, and con_factory been defined?
Controller Services operate independent of processors and thus cannot rely on attributes defined on FlowFiles. The attribute values must be available to the controller service at all times.
The most typical place such attributes (key/value pairs) are in a nifi registry file.
# external properties files for variable registry # supports a comma delimited list of file locations nifi.variable.registry.properties=
set this property to point to a file you created that contains 1 to many key/value pairs.
Then create this file and make sure it is owned and accessible by the user that runs NiFi.
The content so f this file may look something like this:
broker_uri=tcp://localhost:4141 client_libs=/NiFi/custom-lib-dir/MQlib con_factory=blah
Make sure there is only one entry per line and there are no leading or trailing whitespaces on each line. Then restart your NiFi.
The controller service should now appear valid as long as each value above is valid (i.e - defined lob path is valid and exists).
Attributes can also come from NiFi JVM properties defined in bootstrap.conf file and system environment variables defined for user running NiFi.
Thank you,
Matt
Created 04-11-2018 12:39 PM
Where have the key/value pairs for broker_uri,client_libs, and con_factory been defined?
Controller Services operate independent of processors and thus cannot rely on attributes defined on FlowFiles. The attribute values must be available to the controller service at all times.
The most typical place such attributes (key/value pairs) are in a nifi registry file.
# external properties files for variable registry # supports a comma delimited list of file locations nifi.variable.registry.properties=
set this property to point to a file you created that contains 1 to many key/value pairs.
Then create this file and make sure it is owned and accessible by the user that runs NiFi.
The content so f this file may look something like this:
broker_uri=tcp://localhost:4141 client_libs=/NiFi/custom-lib-dir/MQlib con_factory=blah
Make sure there is only one entry per line and there are no leading or trailing whitespaces on each line. Then restart your NiFi.
The controller service should now appear valid as long as each value above is valid (i.e - defined lob path is valid and exists).
Attributes can also come from NiFi JVM properties defined in bootstrap.conf file and system environment variables defined for user running NiFi.
Thank you,
Matt
Created 04-11-2018 01:37 PM
Forum tip: Try to avoid responding to existing "Answers" by creating a new "Answer". To keep threads easy to read, please use comments.
As far as using Process Group level defined variables, you are correct that it is not working as intended. I have created the following Jira to get this addressed:
https://issues.apache.org/jira/browse/NIFI-5073
The NiFi registry File does work however here.
Thank you,
Matt
If you found this answer addressed your question, please take a moment to click "accept" to close this thread.
Created 04-11-2018 02:30 PM
@Matt Clarke Thanks for your response.
I am using NiFi 1.4 since there is an option to specify variables using UI.
Created 04-11-2018 02:31 PM
@Matt Clarke, Thanks for logging this as defect to the NiFi.
I've changed my answer to the comment.
Created 04-11-2018 04:49 PM
Progress of defects will not be tracked/updated in this forum. You can track the progress of this Jira through the Jira link provided above. Can you close this thread by clicking "accept" on an answer?
Thank you,
Matt