Support Questions

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

Nifi - How to process one file at a time

avatar

93315-nifi.png

Shu, please, what is the procedure for processing one file at a time? After unpacking, my files get huge and fill my disk. Is there any configuration in the processor or do I need to restructure my flow? Thank you!

5 REPLIES 5

avatar
Master Guru
@Julio Gazeta

i think you need to use Wait-Notify processors for this case and process each flowfile only once.

Refer to this and this links for more details regards to the design/configure NiFi flow for same exact use case.

avatar

Shu, I read the article https://community.hortonworks.com/articles/191080/trigger-basedserial-data-processing-in-nifi.html but I did not understand how the RouteOnAttribute processor was configured. Apparently the firstFF property was created, however, I did not see the value of this property in the article? Could you please send a simple example of how to process a list of files, one at a time with the wait and notify processors? Thank you!

avatar
Master Guru
@Julio Gazeta

Please configure RouteOnAttribute processor as shown below,

RouteOnAttribute configs:

93376-screen-shot-2018-11-24-at-61858-pm.png

Try to run the flow now.

avatar

Shu, I realized that the Listfile processor did not pick up the same file more than once, even clearing the status. For example, I had processed file1.gz and moved it to another directory, stopped all processors, cleared the status of ListFile and UpdateAttribute, and restarted processing, and even then the ListFile processor did not pick up file1.gz again. Does Nifi store the reference with this file name in some directory of it that I should delete? Thank you!

93727-nifi-1.png

93728-nifi-2.png

avatar
Master Guru
@Julio Gazeta

I don't think NiFi won't store the reference once we clear off the states in the processor.

In your "d:\\tmp\\input" directory have only one file then clear off all states in ListFile processor then

1.start the processor once and then stop the processor and

2.start the ListFile processor again then you are going to list the file from the directory.

-

If the Answer helped to resolve your issue, Click on Accept button below to accept the answer, That would be great help to Community users to find solution quickly for these kind of issues.