Support Questions

Find answers, ask questions, and share your expertise

Can a NIFI Processor Property be an array

avatar
Rising Star

I've got a set of files to upload. I'd like to define this set as an array of URLS. What is the easiest way to define a set of strings, that will be the input to a processor flow that must process each of the strings individually? Can I create this array as a property, and then loop through that array? Alternatively should I place the set of URLS (strings) into a file that I load and then process the content one string at a time?

1 ACCEPTED SOLUTION

avatar
Master Guru
@David Sargrad

Both ways are possible and the easiest way would be using file.

Approach1:

If you want to work with arrays then refer to this link section 2.2 to loop through array and process one string at a time.

Approach2:

You can also keep all url's in a file with new line as row delimiter then use Split Text processor(split one line each) and Extract text processor to extract the content as attribute and use the attribute value to make the call.

Refer to this and this link for more details regards to second approach and serial data processing using NiFi.

View solution in original post

2 REPLIES 2

avatar
Master Guru
@David Sargrad

Both ways are possible and the easiest way would be using file.

Approach1:

If you want to work with arrays then refer to this link section 2.2 to loop through array and process one string at a time.

Approach2:

You can also keep all url's in a file with new line as row delimiter then use Split Text processor(split one line each) and Extract text processor to extract the content as attribute and use the attribute value to make the call.

Refer to this and this link for more details regards to second approach and serial data processing using NiFi.

avatar
Rising Star

Thank you very much. I'll try these this week. Great detail in your response.. appreciated.