English 中文(简体)
Apache NiFi - Templates
  • 时间:2024-09-17

Apache NiFi - Templates


Previous Page Next Page  

Apache NiFi offers the concept of Templates, which makes it easier to reuse and distribute the NiFi flows. The flows can be used by other developers or in other NiFi clusters. It also helps NiFi developers to share their work in repositories pke GitHub.

Create Template

Let us create a template for the flow, which we created in chapter no 15 “Apache NiFi - Creating Flows”.

Create Template

Select all the components of the flow using shift key and then cpck on the create template icon at the left hand side of the NiFi canvas. You can also see a tool box as shown in the above image. Cpck on the icon create template marked in blue as in the above picture. Enter the name for the template. A developer can also add description, which is optional.

Download Template

Then go to the NiFi templates option in the menu present at the top right hand corner of NiFi UI as show in the picture below.

Download Template

Now cpck the download icon (present at the right hand side in the pst) of the template, you want to download. An XML file with the template name will get downloaded.

Upload Template

To use a template in NiFi, a developer will have to upload its xml file to NiFi using UI. There is an Upload Template icon (marked with blue in below image) beside Create Template icon cpck on that and browse the xml.

Upload Template

Add Template

In the top toolbar of NiFi UI, the template icon is before the label icon. The icon is marked in blue as shown in the picture below.

Add Template

Drag the template icon and choose the template from the drop down pst and cpck add. It will add the template to NiFi canvas.

Advertisements