Skip to main content
manishg
Gold ⭐️
Mar 18, 2024 3:04 AM UTC
Question

How to make a copy of input file?

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

SAMSAL
Platinum ⭐️⭐️⭐️
Mar 18, 2024 8:23 AM UTC

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.

Translate
manishg
manishgAuthor
Gold ⭐️
Mar 18, 2024 8:25 AM UTC

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

Translate
SAMSAL
Platinum ⭐️⭐️⭐️
Mar 18, 2024 8:27 AM UTC

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

 

Translate
manishg
manishgAuthor
Gold ⭐️
Mar 19, 2024 5:53 AM UTC

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

Translate