Support Questions

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

Does NiFi have a means of updateable variables/configs accessible to Expression Language?

avatar

I've seen the nifi.variable.registry.properties config, but those seem to by loaded statically and only at NiFi start.

I have a use case where connection strings and other environment settings need to be read periodically from a DataBase and used to control, for example, the hostname and directory for GetSFTP. How can I achieve this?

1 ACCEPTED SOLUTION

avatar

@Randy Gelhausen There are a few ways to do this.

  1. Use the distributed map cache to get runtime attribute lookups and re-populate it as needed with new configs.
  2. Use a scripted processor to lookup your config values and merge the attributes on to the FlowFile.
  3. I have some work in progress extending a lookup table service by @Andrew Grande that can do lookups against a properties file that is reloaded periodically. It includes a LookupAttribute processor that can merge in either specific properties or all the properties from a properties file. See: https://github.com/jfrazee/nifi-lookup-service/tree/file-based-lookup-service

View solution in original post

1 REPLY 1

avatar

@Randy Gelhausen There are a few ways to do this.

  1. Use the distributed map cache to get runtime attribute lookups and re-populate it as needed with new configs.
  2. Use a scripted processor to lookup your config values and merge the attributes on to the FlowFile.
  3. I have some work in progress extending a lookup table service by @Andrew Grande that can do lookups against a properties file that is reloaded periodically. It includes a LookupAttribute processor that can merge in either specific properties or all the properties from a properties file. See: https://github.com/jfrazee/nifi-lookup-service/tree/file-based-lookup-service