Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

How to Write FlowFiles to Multiple Locations Sequentially in Apache NiFi Without Notify/Wait

avatar

80384-waitnotify.png

HI,

I would like to create data flow,which put file to one directory, and the if it has succeded, put the same file to another directory

I use for that Notify/Wait, but I wonder if uuid is a good solution for the signal,

Are Wait/Notify properties adequate ?

or if there is another way ?

80388-wait.png

80387-notify.png

1 ACCEPTED SOLUTION

avatar
Master Mentor
@Tommy

-

Why even use the "wait" and "notify" processors in this scenario?

-

All you need to do is feed the "success" relationship form location A PutFile processor to the processor writing to location B. Same file will be written to both locations and will only be written to location B if Location A was successful.

-

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

4 REPLIES 4

avatar
Master Mentor
@Tommy

-

Why even use the "wait" and "notify" processors in this scenario?

-

All you need to do is feed the "success" relationship form location A PutFile processor to the processor writing to location B. Same file will be written to both locations and will only be written to location B if Location A was successful.

-

Thank you,

Matt

-

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

avatar
Master Mentor
@Tommy

-

*** Forum tip: Please try to avoid responding to an Answer by starting a new answer. Instead use the "add comment" tp respond to en existing answer. There is no guaranteed order to different answers which can make following a response thread difficult especially when multiple people are trying to assist you. Also use the @username when replying to make sure user gets notified about your response.

-

You need to answer the question:
What links these two FlowFiles to one another?
-

Since you are evaluating FlowFiles in pairs. What if you get two Files of type A. How do you want the processor to know what file type B belongs with which of the two type files that already arrived?

-

If this is not a concern you could use a simple wait/notify flow as described here to accomplish this:
https://gist.github.com/ijokarumawak/375915c45071c7cbfddd34d5032c8e90
-
Thanks,

Matt

avatar

Ok, thanks Matt, this template helps me

avatar

ok you are right, for this kind of flow

but when I have for example:

- one flow for data acquisition from source to Cassandra in one process group

- second flow for data ingestion from Cassandra in another process group

How to set properties in Wait/Notify in this kind of flow ?

Unless there is also possible another solution ..