Sateesh Telaprolu
Sateesh Telaprolu

Reputation: 150

Does nifi supports Transfering single Flow file to multiple Relationships in a Processor?

I am exploring options for Transferring single Flowfile to two or more Relationships in my custom processor,i didn't found any help in documentation for this, Does this feature supported by NIFI?

Example Code:

session.transfer(flowFile, REL_SUCCESS_1);
session.transfer(flowFile, REL_SUCCESS_2);

Upvotes: 3

Views: 936

Answers (1)

daggett
daggett

Reputation: 28564

you can use session.clone() method:

FlowFile flowFile2 = session.clone(flowFile);
session.transfer(flowFile, REL_SUCCESS_1);
session.transfer(flowFile2, REL_SUCCESS_2);

to create a full clone of the flow file.

the content and attributes will be the same...

Upvotes: 7

Related Questions