Hi Anil,
1. I'd use MonitorActivity, too.
Assuming you want to do something when there is no new files listed by
ListSFTP at a scheduled time.
Then you can add MonitorActivity in between ListSFTP and FetchSFTP.
ListSFTP -> MonitorActivity --success--> FetchSFTP
+--inactive--> LogAttribute
Let's say the desired scheduling interval is 1 hour to list,
ListSFTP's run schedule is 1 hour. Then, MonitorActivity can be
configured to emit 'inactive' signal if it does not see any FlowFile
passed by ListSFTP longer than 1 hour, for example:
"Threshold Duration": "61 min"
The additional 1 minute is for a delay to fire 'inactive' signal, to
allow ListSFTP being delayed a bit in certain situation.
Then, MonitorActivity will create a FlowFile to send to 'inactive'
relationship if ListSFTP didn't find any file when it runs, to trigger
an alternative flow path, that is LogAttribute in the above example.
2. FetchSFTP does not support wild card for a remote file path, it
needs incoming FlowFiles to pass the complete absolute remote file
path.
Thanks,
Koji
On Sat, May 26, 2018 at 7:07 PM, Anil Rai <[email protected]> wrote:
> Below is my scenario
>
> On scheduled time, pick files from a sFTP location and process it further.
> I have two questions regarding this.
>
> 1. To do this, I am using ListSFTP -> routeOnAttribute to filter
> filename with known prefix-> FetchSFTP. I want to know what is the best way
> to figure out or get a message when there is no file in the location at
> the scheduled time. I am thinking of using MonitorActivity to keep track of
> any flowfiles generated in ListSFTP, but I am not sure how to configure it.
> 2. Also, I already know the prefix of the files I will need. So is there
> a way to know put a wild card search in the remote path property of
> FetchSFTP, so that I can remove ListSFTP altogether?
>
>
> Thanks
> Anil