Newbie question about NIFI using InvokeHTTP

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbie question about NIFI using InvokeHTTP

Chris Mangold
I could not find a user subscriber list so if my email needs to be directed
else where please let me know.

I am trying to use NIFI to crack open a file of text and forward the
content to a REST service that Natural Language Processing REST endpoint.

I use GetFile processor to read the content and send it on to InvokeHTTP
process. Request goes out but I receive a "415 unsupported media type"
error.  Is there a way I can change the content-header to
application/text.or do I need to change the format using CompressContent.

Maybe I need to write a custom Processor.

Thanks for your help.

Chris
Reply | Threaded
Open this post in threaded view
|

Re: Newbie question about NIFI using InvokeHTTP

Joe Witt
Hello Chris,

You could put an UpdateAttribute processor in between GetFile and
InvokeHttp.  In that processor just add an attribute called
'Content-Type' with a value of 'application/text'.  On the InvokeHttp
processor just make sure you specify the attribute 'Attributes to
Send' and provide a regex that includes your Content-Type attribute.

You certainly can use CompressContent if you need to have the data
compressed or decompressed.  But sounds like that might not be needed
here.

To get a really good understanding of the attributes on the flow file
that NiFi knew when the data entered InvokeHttp you can utilize the
provenance feature.  A bit more documentation about that can be found
here [1].  With that capability you can pretty much walk through the
flow and see what it looks like at each stage.  With the 0.1.0 release
we plan to include a stock content viewer too so that will allow you
to even see exactly what the content was.

[1] http://nifi.incubator.apache.org/docs/nifi-docs/user-guide.html#data-provenance

...we don't yet have a user alias so you came to the right place.
Feel free to ask questions as much as you need.  And if there are
things that seem more complicated than they should be please let us
know.

Thanks
Joe

On Wed, Mar 18, 2015 at 11:40 PM, Chris Mangold <[hidden email]> wrote:

> I could not find a user subscriber list so if my email needs to be directed
> else where please let me know.
>
> I am trying to use NIFI to crack open a file of text and forward the
> content to a REST service that Natural Language Processing REST endpoint.
>
> I use GetFile processor to read the content and send it on to InvokeHTTP
> process. Request goes out but I receive a "415 unsupported media type"
> error.  Is there a way I can change the content-header to
> application/text.or do I need to change the format using CompressContent.
>
> Maybe I need to write a custom Processor.
>
> Thanks for your help.
>
> Chris
Reply | Threaded
Open this post in threaded view
|

Newbie question about NIFI using InvokeHTTP

Chris Mangold
Thanks for your Response Joe that was a big help got me over the hump.

On Wed, Mar 18, 2015 at 11:55 PM, Joe Witt <[hidden email]
<javascript:_e(%7B%7D,'cvml','[hidden email]');>> wrote:

> Hello Chris,
>
> You could put an UpdateAttribute processor in between GetFile and
> InvokeHttp.  In that processor just add an attribute called
> 'Content-Type' with a value of 'application/text'.  On the InvokeHttp
> processor just make sure you specify the attribute 'Attributes to
> Send' and provide a regex that includes your Content-Type attribute.
>
> You certainly can use CompressContent if you need to have the data
> compressed or decompressed.  But sounds like that might not be needed
> here.
>
> To get a really good understanding of the attributes on the flow file
> that NiFi knew when the data entered InvokeHttp you can utilize the
> provenance feature.  A bit more documentation about that can be found
> here [1].  With that capability you can pretty much walk through the
> flow and see what it looks like at each stage.  With the 0.1.0 release
> we plan to include a stock content viewer too so that will allow you
> to even see exactly what the content was.
>
> [1]
> http://nifi.incubator.apache.org/docs/nifi-docs/user-guide.html#data-provenance
>
> ...we don't yet have a user alias so you came to the right place.
> Feel free to ask questions as much as you need.  And if there are
> things that seem more complicated than they should be please let us
> know.
>
> Thanks
> Joe
>
> On Wed, Mar 18, 2015 at 11:40 PM, Chris Mangold <[hidden email]
> <javascript:_e(%7B%7D,'cvml','[hidden email]');>> wrote:
> > I could not find a user subscriber list so if my email needs to be
> directed
> > else where please let me know.
> >
> > I am trying to use NIFI to crack open a file of text and forward the
> > content to a REST service that Natural Language Processing REST endpoint.
> >
> > I use GetFile processor to read the content and send it on to InvokeHTTP
> > process. Request goes out but I receive a "415 unsupported media type"
> > error.  Is there a way I can change the content-header to
> > application/text.or do I need to change the format using CompressContent.
> >
> > Maybe I need to write a custom Processor.
> >
> > Thanks for your help.
> >
> > Chris
>



--
Chris Mangold
301-471-5758 (c)
301-898-7979 (h)


--
Chris Mangold
301-471-5758 (c)
301-898-7979 (h)