Support Questions

Find answers, ask questions, and share your expertise

how to set Processor properties dynamically from xml file in Nifi

avatar
Explorer

Hi Team,

I just started working on NiFi. Need someone's help on my new requirement.

My Requirement: I want to read files from one folder and place the files in another server.

Here based on filename, i have to move the files to different servers. for this i followed below steps.

for reading the file from folder used getFile processor and connected to putSFTP processor to move the file destination folder. Reading get file processor file properties are static and Destination properties need to change based on input filename.

These properties from putSFTP processor need to set dynamically.

Can you please help us to do. Hostname: Port: username: password: Remote path: ---------------

i will maintain all these properties in xml file.

1) how to set these properties dynamically from xml based on input filename in running time..

2) if i create xml as template, how to pass those values to putSFTP processor.

Can you please help me on this. how to solve this.

Thanks, in advance.

Thanks,

Rangareddy Y

1 ACCEPTED SOLUTION

avatar
Master Mentor

@Rangareddy Y

-

NiFi does not support dynamic property creation from an XML based input file.

Some properties on some processors will support NiFi's Expression Language (EL) which would allow supporting properties to retrieve a defined variables value. Those key/value variables can be defined in a number of places:

1. On the incoming FlowFiles to that NiFI processor in the form of FlowFile Attributes.

2. On the NiFi Process Group that contains your processors

3. From a NiFi variable registry file. (key/value property file. Cannot be updated in real time. changes to this file would require a NiFi restart)

4. NiFI JVM properties defined in NiFi's bootstrap.conf file (Restart required each time this file is edited)

5. NiFI process owner's environment variables (Restart of NiFi Required if user env variables are edited/added)

-

None of NiFi's processors will support the use of EL to define processor sensitive property values like passwords.

Floating over the small "question mark" icon to the right of a property name in a processor will indicate if the use fo EL is supported by that processor configuration property.

-

Referenced documentation on NiFi's EL:

https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html
https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#custom_properties

-

Thank you,

Matt

-

When an "Answer" addresses/solves your question, please select "Accept" beneath that answer. This encourages user participation in this forum.

View solution in original post

1 REPLY 1

avatar
Master Mentor

@Rangareddy Y

-

NiFi does not support dynamic property creation from an XML based input file.

Some properties on some processors will support NiFi's Expression Language (EL) which would allow supporting properties to retrieve a defined variables value. Those key/value variables can be defined in a number of places:

1. On the incoming FlowFiles to that NiFI processor in the form of FlowFile Attributes.

2. On the NiFi Process Group that contains your processors

3. From a NiFi variable registry file. (key/value property file. Cannot be updated in real time. changes to this file would require a NiFi restart)

4. NiFI JVM properties defined in NiFi's bootstrap.conf file (Restart required each time this file is edited)

5. NiFI process owner's environment variables (Restart of NiFi Required if user env variables are edited/added)

-

None of NiFi's processors will support the use of EL to define processor sensitive property values like passwords.

Floating over the small "question mark" icon to the right of a property name in a processor will indicate if the use fo EL is supported by that processor configuration property.

-

Referenced documentation on NiFi's EL:

https://nifi.apache.org/docs/nifi-docs/html/expression-language-guide.html
https://nifi.apache.org/docs/nifi-docs/html/administration-guide.html#custom_properties

-

Thank you,

Matt

-

When an "Answer" addresses/solves your question, please select "Accept" beneath that answer. This encourages user participation in this forum.