nifi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Bende <bbe...@gmail.com>
Subject Re: Route Original Flow File Base on InvokeHTTP Response
Date Mon, 03 Aug 2015 20:10:02 GMT
Steve,

I agree with Adam's idea of using InvokeHTTP.

I created an example flow that I believe demonstrates what you are trying
to do. You can download the template here
(InvokeHttp_And_Route_Original_On_Status.xml):
https://cwiki.apache.org/confluence/display/NIFI/Example+Dataflow+Templates

The example searches Google every 30 seconds for a query that was specified
in a FlowFile attribute (in this case q=nifi), and then routes the original
FlowFile to a HashContent processor whenever a 200 was received from
Google. The HashContent would be replaced with whatever you wanted to do.

Let us know if you have any questions.

-Bryan

On Mon, Aug 3, 2015 at 2:52 PM, Adam Taft <adam@adamtaft.com> wrote:

> If you're needing to read the HTTP response code, InvokeHTTP should do this
> for you.  It basically stores the HTTP response code into the original
> request flowfile.  With a 2xx response code, it will route the request
> flowfile (with the response code attributes) to the "Original"
> relationship.  From there, the flowfile should have a
> "invokehttp.status.code" attribute which you can act on.
>
>
>
>
> On Mon, Aug 3, 2015 at 1:46 PM, steveM <stephen.c.metcalf@lmco.com> wrote:
>
> > I have a use case where I need to call a web service based on a flow file
> > attribute then route the original flow file based on the response from
> the
> > web service call. Can this be done using the standard processors and if
> so,
> > how?
> >
> >
> >
> > --
> > View this message in context:
> >
> http://apache-nifi-incubating-developer-list.39713.n7.nabble.com/Route-Original-Flow-File-Base-on-InvokeHTTP-Response-tp2317.html
> > Sent from the Apache NiFi (incubating) Developer List mailing list
> archive
> > at Nabble.com.
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message