Support Questions

Find answers, ask questions, and share your expertise

How to make a copy of input file?

avatar
Expert Contributor

I have a usecase wherein in case of an error I need to make a copy of input file and send it to some FTP location so that it can be assessed.

What is idiomatic way of achieving this? 

4 REPLIES 4

avatar
Super Guru

Hi @manishg ,

Can you be more specific when you say "an error"? is  it an error on a processor or is it error in nifi system? if its an  error on processor what kind of processor and what kind of error are you getting or working with?

Generally speaking, when a processor fails it sends the flowfile to the failure relationship which you can capture and do what is needed to handle this error, however every processor behaves a little different from one another , also the nature of error can sometimes decide what can happen. In my experience I have seen different behaviors as follows:

1- flowfile is sent to the failure relationship which what you expect

2- flowfile is lost even though the failure relationship is captured. this usually happens upon fatal error and\or uncaptured exceptions.

3- flowfile is pushed to the upstream queue and penalize.

avatar
Expert Contributor

Error is in processor. Basically a functional error, nothing to do with nifi.

avatar
Super Guru

What kind of processor? most of processors have failure relationship which you can  capture and do the error handling of that.

If that helps please accept solution.

Thanks

 

avatar
Expert Contributor

Its a script processor to run a groovy script. If a functional error is detected, I need to send original input file over FTP.