Support Questions
Find answers, ask questions, and share your expertise

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

Solved Go to solution
Highlighted

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

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

Accepted Solutions
Highlighted

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

Master Guru
@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
Highlighted

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

Master Guru
@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

Highlighted

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

Master Guru
@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

Highlighted

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

Ok, thanks Matt, this template helps me

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

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