0
votes

In My data flow, I am writing the data to a csv and naming the file along with timestamp. After that PUTFILE processor is placing this file in a folder location. I want to make resp api call to this and get the name of files from Apache Nifi and show the file details in application UI. How can I achieve this?

1
Check handlehttprequest and handlehttpresponse processors - daggett

1 Answers

1
votes

You can use HandleHttpRequest to actively listen to incoming requests. Here's what your processor configuration should look like:

enter image description here

For simplicity, I've allowed all paths while listening to any requests.

Once you receive a request, the next step is to proceed with your operation (Getting the name of files in your case). Finally attach a HandleHttpResponse processor in the end to send the response to the client.

enter image description here

Using HTTP response code 200 here as it means the status is OK. HandleHttpResponse responds to the client with any incoming flowfile content. So, if you route the list of your filenames in a single flowfile to this processor, it will share the content to the one who requested it.

Here's a sample end to end flow:

enter image description here