nifi-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aldrin Piri <aldrinp...@gmail.com>
Subject Re: Run process after getting a file
Date Mon, 28 Sep 2015 15:58:20 GMT
Odin,

* Saw Rick's message come in while typing this and I believe this may very
well be causing your issue, but don't think changing that will resolve your
issues.

* Saw your response just come in.  This has been a highly interrupted email
process spanning a long interval! :)

Part of the issue is that the file, when brought into the flow by GetFile
is that the filename is its name within NiFi and not in the external
environment.  The best way to handle the invocation of the jar would be to
handle the content via STDIN for the JAR.  filename itself will not give
your jar a path where it can find a file.

Depending on your use case, you could approximate that by having the
GetFile keep the source files and then using absolute.path in conjunction
with filename in expression language: ${absolute.path}/${filename}.  This
would not remove files from that directory, so you would need some way to
clean these up after carrying out your processing.

We have had talk of creating a ListFile processor which seems like it would
be helpful for this situation, but has yet to be implemented.  [1]

[1] https://issues.apache.org/jira/browse/NIFI-631

On Mon, Sep 28, 2015 at 11:30 AM, Rick Braddy <rbraddy@softnas.com> wrote:

> Ignore STDIN = true (you don’t have anything flowing into stdin, as I
> understand it)
>
>
>
> *From:* Odin Guillermo Caudillo Gallegos [mailto:odin.guillermo@gmail.com]
>
> *Sent:* Monday, September 28, 2015 10:06 AM
>
> *To:* users@nifi.apache.org
> *Subject:* Re: Run process after getting a file
>
>
>
> Ok, so i'm using the following configuration on the ExecutingStreamProcess:
>
> command args = -jar;myJar.jar;${filename};/outputfolder
>
> command path = java
>
> Ignore STDIN = false
>
> It gives me a :Failed to write flow file to stdin due to
> java.io.IOException: Broken pipe: java.io.IOException: Broken pipe
>
>
>
> I'm using GetFile->ExecutingStreamProcess do i miss something? i run the
> jar from a terminal and works fine.
>
> Thanks
>
>
>
> 2015-09-25 19:01 GMT-05:00 Joe Witt <joe.witt@gmail.com>:
>
> command path = java
> command args = -jar;${filename}
>
> That might do the trick.
>
> Thanks
> Joe
>
>
> On Fri, Sep 25, 2015 at 7:59 PM, Rick Braddy <rbraddy@softnas.com> wrote:
> > Expression language in ExecuteStreamProcess could be your friend here to
> use
> > the filename attribute to set the process arguments.
> >
> >
> > On Sep 25, 2015, at 6:12 PM, Odin Guillermo Caudillo Gallegos
> > <odin.guillermo@gmail.com> wrote:
> >
> > Great it works, now, is it possible to get like a .txt from the GetFile
> flow
> > and use it to execute a java -jar <file from flow> as an input value?
> >
> > 2015-09-25 17:56 GMT-05:00 Odin Guillermo Caudillo Gallegos
> > <odin.guillermo@gmail.com>:
> >>
> >> Ok i'll give it a try
> >>
> >> 2015-09-25 17:40 GMT-05:00 Rick Braddy <rbraddy@softnas.com>:
> >>>
> >>> I think I misread your inquiry.  ExecuteProcess is scheduled only by
> >>> Timer or Cron schedule today; however, ExecuteStreamCommand support the
> >>> "Event" trigger method, which may meet your needs.
> >>>
> >>> Rick
> >>>
> >>> -----Original Message-----
> >>> From: Rick Braddy [mailto:rbraddy@softnas.com]
> >>> Sent: Friday, September 25, 2015 5:32 PM
> >>> To: users@nifi.apache.org
> >>> Subject: Re: Run process after getting a file
> >>>
> >>> Not today.  GetFile must start a flow.
> >>>
> >>> There are discussions underway on a proposal to introduce some new file
> >>> processors that are event triggered and dynamically configured
> (incoming
> >>> FlowFile contains path to file)
> >>>
> >>> Rick
> >>>
> >>> > On Sep 25, 2015, at 5:28 PM, Odin Guillermo Caudillo Gallegos
> >>> > <odin.guillermo@gmail.com> wrote:
> >>> >
> >>> > Hi, is it possible to run the ExecuteProcess after using GetFile? The
> >>> > idea is to not use the scheduling feature but trigger it with
> GetFile.
> >>> >
> >>> > Thanks
> >>
> >>
> >
>
>
>

Mime
View raw message