Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

multiple listenHttpProcessor on same port in nifi

multiple listenHttpProcessor on same port in nifi

Expert Contributor

The webhook I am getting data from allows only port 80 to listen to it. I am using Nifi to get events from this webhook and first ListenHttp Processor on port 80 works fine. How do I run more ListenHttp Processors on this same port? is that not possible using diff. base url's? If not, what is the workaround?

6 REPLIES 6

Re: multiple listenHttpProcessor on same port in nifi

Hi @Simran Kaur,

That's not possible. However you can do a single ListenHttp followed by a RouteOnAttribute that will route the flow files based on the requested URL (the attribute should be http.request.url).

Hope this helps.

Re: multiple listenHttpProcessor on same port in nifi

Expert Contributor

Oh, that sounds very nice. Could I find more examples on using RouteOnAttribute ? I looked at the usage and there is not much explanation there.

Re: multiple listenHttpProcessor on same port in nifi

Expert Contributor

Re: multiple listenHttpProcessor on same port in nifi

Expert Contributor

and how do I exactly know what the attribute is called? for ex. http.request.url ?

Re: multiple listenHttpProcessor on same port in nifi

Expert Contributor

Also, I was looking at the attributes of those in queue>

path

restlistener.remote.source.host

filename

restlistener.remote.user.dn

uuid

Why do I not see http.request.url here ? @Pierre Villard

Re: multiple listenHttpProcessor on same port in nifi

You're right, ListenHttp cannot be used as I said... I was thinking about the use of HandleHttpRequest and HandleHttpResponse. With ListenHttp you cannot actually access multiple URLs.

An example could be:

https://pierrevillard.com/2017/01/31/nifi-and-oauth-2-0-to-request-wordpress-api/

Hope this helps.