Apache Nifi Custom Processor and Controller services

1. Generate Nifi Processor Template code using the maven archetype :-
1. Open command prompt and run “mvn archetype:generate”

You will get list of Archtypes available.

2. Search for nifi Archetype project or apply filter as “nifi”

You will get two nifi Archetypes for Nifi processor and controller service.

3.Select org.apache.nifi:nifi-processor-bundle-archetype project and then select the Nifi Version(as shown below) for which you want to develop custom processor.

4. Define maven project properties like groupId, artifactId, version as mentioned below:-

groupId: com.futurexskills.custom
artifactId: nifi-custom-processor
version: 1.0-SNAPSHOT
package: com.futurexskills.custom.processors.sample

5. Maven project with default MyProcessor will be created.

2. Develop and Deploy Custom Processor in Nifi:-

  1. Open the project/code generated in the previous step.

  2. Update and add your custom code for processing the flow file.

  3. Go to Custom processor project directory and run “mvn clean install -Denforcer.skip=true”

jar file for the custom processor is generated

4. Place the .jar file in lib or extension folder of Nifi.

Go to the “nifi-sampl-nar–>trget” folder, copy the jar file and place it under the Nifi libs or extension folder

If you place the nar file in lib folder you need to restart your Nifi cluster. You dont need to restart if you place your nar file in the “extension” directory.

Leave a Reply

Your email address will not be published. Required fields are marked *