Apache NiFi Quickstart Guide
- If you want to learn Apache NiFi with examples, this tutorial is for you.
- This tutorial is only for learning to use Apache NiFi, and using a local instance of NiFi is the best way to do that.
- Data Spine NiFi is a central, cloud-native component in the EFPF ecosystem. If you are already familiar with using Apache NiFi, you can get started with the DS NiFi User Guide to use Data Spine NiFi directly.
- Docker Desktop/Engine is installed
- Download this template to be loaded to NiFi later: Template
- In this tutorial, we will load an existing template onto NiFI’s (GUI) canvas and run it. Alternatively, you can also drag-and-drop processors onto the canvas, and connect them together to create a dataflow.
- The dataflow in this template creates a reverse proxy endpoint for an existing external HTTP API endpoint: SMECluster Platform’s Marketplace Service that returns a list of available products and services. This service is publicly accessible.
- That is, the dataflow listens for HTTP GET requests, and upon receiving a request, it calls SMECluster’s Marketplace Service, gets the response and returns it to the caller.
docker run -d --name nifi -p 8080:8080 -p 8091:8091 apache/nifi:latestto start NiFi.
- Navigate to http://localhost:8080/nifi/ in a Web browser. NiFi should serve its homepage:
- On the homepage of NiFi, click on the ‘Upload Template’ button on the ‘Operate Palette’ and select the template “
SMECluster_GetAllProducts_Proxy.xml” to be uploaded.
- To add this uploaded template to the ‘Canvas’, drag-and-drop the ‘Template (+)’ button from the ‘Components Toolbar’ onto the canvas and choose the template to be uploaded:
- Now, you should be able see the template as a Process Group on the Canvas.
- If you encounter an error while starting the workflow processors similar to ‘HTTP Context Map validated against xxxx is invalid because Controller Service xxxx is disabled’, you will need to enable the StandardHttpContextMap controller service.
- To enable the StandardHttpContextMap controller service, goto the home screen of NiFi (http://localhost:8080/nifi/), right click on the concerned process group and then click on ‘Configure’.
- On the configuration page, ‘CONTROLLER SERVICES’ tab, click on ‘Go To’ (→).
- On the ‘NiFi Flow Configuration’ page, ‘CONTROLLER SERVICES’ tab, click on ‘Enable’ (⚡).
- Finally, on the page, click on the ‘ENABLE’ button. The error should disappear now.
- Next, to start all the processors in this process group, select (single click) the process group and then click the ‘Start’ button on the ‘Operate Palette’:
- Alternatively, you can also view the NiFi workflow by double clicking on the process group and then select and start the processors individually:
- That’s it! Now, you can invoke http://localhost:8091 from the Web browser (or Postman, or using cURL) and get the response:
Data Spine NiFi Documentation
- Data Spine NiFi Overview
- Data Spine NiFi User Guide
- DS NiFi Integration Flow Examples
- NiFi Data Transformation Examples
- Data Spine NiFi Admin Guide
 Getting Started with Apache NiFi:
 Apache NiFi Documentation: https://nifi.apache.org/docs.html