Integration / Apache NiFi Interview Questions
What is the HandleHttpRequest and HandleHttpResponse processor pair used for?
HandleHttpRequest and HandleHttpResponse implement an HTTP server inside NiFi, enabling NiFi to act as a web service endpoint that receives HTTP requests from external clients, processes them as FlowFiles through the flow, and returns HTTP responses.
HandleHttpRequest: Starts an embedded Jetty HTTP server listening on a configured port and path. When a client sends an HTTP request, the processor creates a FlowFile from the request body and enriches it with request attributes: http.method, http.url, http.query, all HTTP headers as attributes, and a http.context.identifier that uniquely links this request to its response.
HandleHttpResponse: Receives a processed FlowFile and sends its content back to the waiting HTTP client as the response body. It uses the http.context.identifier attribute to match the response to the original request. The HTTP status code can be set statically or from a FlowFile attribute.
The use case is building NiFi-powered APIs or webhook receivers. A webhook receiver, for example, can accept JSON payloads from a GitHub push event, validate the HMAC signature using ExecuteScript, enrich the payload via UpdateAttribute, and store it in a database via PutDatabaseRecord — all while responding 202 Accepted to the GitHub server.
A StandardHttpContextMap Controller Service is required to hold open HTTP connections between HandleHttpRequest and HandleHttpResponse. The maximum open connections setting determines concurrency.
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
