Support Questions

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

How to use Notify/Wait in PutFile in two different locations

avatar
Contributor

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
Super 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
Super 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
Super 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
Contributor

Ok, thanks Matt, this template helps me

avatar
Contributor

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 ..