Support Questions
Find answers, ask questions, and share your expertise

how to keep Environmental property file in cache , which will be used across the processor.

Hi Team,

I have requirement like need to read the environment property file and keep in memory, also need to auto refresh is any update done in property file. Example Env.properties

parent_path = /sourcesystem/country/

Auth_key = 234234fsdaf234

password =**************

IN = india

i need to use the above property in my processor across the flow. Example in ListFile processor i want to use ${parent_path} , this should replace "/sourcesystem/country/ " value.

1 ACCEPTED SOLUTION

Accepted Solutions

Guru

There are 2 ways to do it:

1) Custom properties file

  • put name=value pairs in custom property file: parent_path=/sourcesystem/country/
  • put custom property file in a location you choose on the nifi cluster
  • open the existing nifi.properties file
  • for property nifi.variable.registry.properties, set it to the path to your custom property file (or a csv of a list of custom property files)
  • in your processor, use ${parent_path} as you indicate

2) OS environment variable (best for sensitive values not to be exposed in a file)

  • set the OS environment variable: export Auth_key=234234fsdaf234
  • reference ${Auth_key} in your processor

The following links show more details

View solution in original post

4 REPLIES 4

Guru

There are 2 ways to do it:

1) Custom properties file

  • put name=value pairs in custom property file: parent_path=/sourcesystem/country/
  • put custom property file in a location you choose on the nifi cluster
  • open the existing nifi.properties file
  • for property nifi.variable.registry.properties, set it to the path to your custom property file (or a csv of a list of custom property files)
  • in your processor, use ${parent_path} as you indicate

2) OS environment variable (best for sensitive values not to be exposed in a file)

  • set the OS environment variable: export Auth_key=234234fsdaf234
  • reference ${Auth_key} in your processor

The following links show more details

View solution in original post

I tried with 1) Custom properties file. This is working. Thank you Greg Keys

New Contributor

Thanks @Greg Keys for your quick response. Custom Properties file is working absolutely fine

Guru

Glad it helped 🙂 (If you want to get more reuse from nifi, see first link in answer for reusing templates during development).