Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

multiple listenHttpProcessor on same port in nifi

avatar
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

avatar

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.

avatar
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.

avatar
Expert Contributor

avatar
Expert Contributor

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

avatar
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

avatar

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.