Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Celebrating as our community reaches 100,000 members! Thank you!
Labels (2)
avatar
Cloudera Employee

When developing NiFi flows with python, it's sometimes a headache to build customized configurations for your processors. Every processor is different and has many different parameters to customize depending on your flows needs and requirements. To accelerate development, I use the development tools in my chrome browser to help accelerate development by extracting the config files from the rest calls the NiFi application makes. 

 

Open your browser and point it to your NiFi instances. Once in the UI right click on the gray bar and select "inspect".

Screen Shot 2019-09-10 at 11.37.04 AM.png

This will open up a development view of the UI. Next, click on the network tab to view and debug network activity. 

 

Screen Shot 2019-09-10 at 11.38.46 AM.png

In this view, all network related traffic will be displayed here. 

 

Screen Shot 2019-09-10 at 11.44.04 AM.png

 

Notice you can see all the rest calls that the NiFi is making behind the scene. This can be quite helpful when customizing processors. When you drag a processor on the canvas and parameterize it, a rest call is made that creates the processor. Along with that processor creation rest call is a configuration payload that we can capture and use with our NiFi python development. 


Example:

 

Create a simple generate flow file processor. When you drag it into the canvas you'll see an entry be posted to the network. It will be the rest call made to create the processor. If you scroll down to the request payload, you'll get a view of the configuration that was submitted with the processor. 

 

Screen Shot 2019-09-10 at 11.51.44 AM.png

 

Screen Shot 2019-09-10 at 11.49.42 AM.png

 

Screen Shot 2019-09-10 at 11.49.59 AM.png

 

 

Next, update the processor by changing the flow file custom text. You'll immediately see an new event posted on the network. This event will give you the configuration for the processor:

 

Screen Shot 2019-09-10 at 11.55.05 AM.png

 

Here is the JSON representation:

 

Screen Shot 2019-09-10 at 11.54.45 AM.png

 

Using this tool you can easily extract the configuration properties for any processor and use them when designing programatic flows using python. 

582 Views
0 Kudos
webinar banner
Version history
Last update:
‎09-10-2019 10:26 AM
Updated by:
Contributors
meetups banner