Support Questions

Find answers, ask questions, and share your expertise

Nifi execute streamcommand Failed to  write flow file to stdin due to broken pipe:java.io.IOException:Broken pipe

avatar
Expert Contributor

Hi Team,

 

I'm trying to merge two files(.pdf format) and combine it to one file using execute streamcommand using jar file. at java side the merge is working using the same jar. but nifi side the command is not working  , instead of merging files it pushing both individual files to outputstream and throwing the below error at  execute streamcommand processor.

"Failed to  write flow file to stdin due to broken pipe:java.io.IOException:Broken pipe"

Below is flow which i'm using 

 

PradNiFi1236_1-1670947066838.png

 

and the command Arguements which i'm using is

-jar;pdfmerge-0.0.1-SNAPSHOT.jar;/opt/nifi/nifi-current/temppdf/${filename:startsWith('invoice_')};/opt/nifi/nifi-current/temppdf/${filename:startsWith('QRBill_')};/opt/nifi/nifi-current/temp2/Output.pdf

 

and here is my configuration of executeStreamCommand:

PradNiFi1236_2-1670947237730.png

Could you please help me on this?

 

1 ACCEPTED SOLUTION

avatar
Expert Contributor

Hi All,

 

Finally was able to accomplish this task. after changing the Flow to below.

Before keeping the Flowfiles in putFile path updating filename of each flowfile to same name taking two flow files in respected putfile paths (invoice, QRBill) folders separately and placing them in respective folders using 2 put files. then after putfile  adding merge content(actual merging two files not happening here, but we are getting one single output) to get single flowfile and then in the execute. and then in the execute stream command for both inputs giving that same filename for respective folders.

 

Regards,

pradeep

 

 

View solution in original post

1 REPLY 1

avatar
Expert Contributor

Hi All,

 

Finally was able to accomplish this task. after changing the Flow to below.

Before keeping the Flowfiles in putFile path updating filename of each flowfile to same name taking two flow files in respected putfile paths (invoice, QRBill) folders separately and placing them in respective folders using 2 put files. then after putfile  adding merge content(actual merging two files not happening here, but we are getting one single output) to get single flowfile and then in the execute. and then in the execute stream command for both inputs giving that same filename for respective folders.

 

Regards,

pradeep