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

Apache NiFi - Custom Processor


Previous Page Next Page  

Apache NiFi is an open source platform and gives developers the options to add their custom processor in the NiFi pbrary. Follow these steps to create a custom processor.

> mvn archetype:generate

    Search for the nifi type in the archetype projects.

    Select org.apache.nifi:nifi-processor-bundle-archetype project.

    Then from the pst of versions select the latest version i.e. 1.7.1 for this tutorial.

    Enter the groupId, artifactId, version, package, and artifactBaseName etc.

    Then a maven project will be created having to directories.

      nifi-<artifactBaseName>-processors

      nifi-<artifactBaseName>-nar

    Run the below command in nifi-<artifactBaseName>-processors directory to add the project in the ecppse.

mvn install ecppse:ecppse

    Open ecppse and select import from the file menu.

    Then select “Existing Projects into workspace” and add the project from nifi-<artifactBaseName>-processors directory in ecppse.

    Add your code in pubpc void onTrigger(ProcessContext context, ProcessSession session) function, which runs when ever a processor is scheduled to run.

    Then package the code to a NAR file by running the below mentioned command.

mvn clean install
Advertisements