Hosting an API in Nifi

208 views Asked by At

I want to host an API in Nifi using HandleHTTP processor. I would like to get some information/resources about how to do it. I am new to Nifi. Thanks in Advance.

1

There are 1 answers

0
steven-matison On BEST ANSWER

@Prathik

I have created a basic template for you which includes the HandleHttpRequest (inbound port 80 call) a process group for doing something with the JSON, and HandleHttpResponse (provides 200 response code) to respond to inbound call. This is an API in the simplest form with NiFi. Depending on your use case you can build out Process Api Request Process Group to suit your needs. Out of the box you should be able to import template, add/start the StandHttpContextMap Controller Service, Start the flow, then use Postman to send a call to http://yournifihost:80 and have JSON sitting in the bottom of the flow Success Queue.

You can find the template here: https://github.com/steven-matison/NiFi-Templates/blob/master/NiFi_API_with_HandleHttpRequest_Demo.xml

Any my official response to the same question on Cloudera Community here:

https://community.cloudera.com/t5/Support-Questions/Hosting-an-API-in-Nifi/td-p/301966