Custom NiFi processors
NiFi Processors are the basic building blocks of dataflow pipelines. Processors perform specific tasks within the pipeline, such as listening for incoming data, pulling data from external sources, publishing data to external sources, and routing, transforming, or extracting information from flow files. Creating your own custom processor provides a way to perform different operations or to transform flow file content according to specific business requirements.
Before you begin
- Ensure that you have an Internet connection.
- Ensure that you update to the latest version of HCL Commerce. For the purposes of this topic, the minimum required version is HCL Commerce 9.1.10.0.
- An Integrated Developer Environment (IDE) with a Maven plug-in is required. If
the Maven options are not available within your IDE, then you must install the
Maven plug-in. See the M2Eclipse plug-in for more information, and
installation instructions.Note: Rational Application Developer (RAD) is not supported for customizing the Ingest service.
Procedure
- Open a web browser, and go to the HCL License and Delivery portal.
- Search HCL_Commerce_Search_Bundle_9.1.x.x.zip bundle for the desired release (e.g. HCL_Commerce_Search_Bundle_9.1.10.x.zip) and download.
-
Extract the downloaded
HCL_Commerce_Search_Bundle_9.1.x.x.zip bundle and
obtain the project template
commerce-custom-search-bundles-9.1.x.x.zip from
\HCL_Commerce_Search_Bundle_9.1.x.x\commerce-search-bundle\dependencies\nifi\9.x.x
location.
The Parent NiFi folder provides custom NiFi processor packages for versions HCL Commerce 9.1.12.0. and onwards.For example, the V9.1.12.0, commerce-custom-search-bundles-9.1.12.0.zip can be obtained at the following location under the extracted directory; HCL_Commerce_Search_Bundle_9.1.12.0\commerce-search-bundle\dependencies\nifi\9.1.10
- Within the NiFi container, navigate to the /opt/nifi/nifi-current/work/nar/extensions/commerce-search-processors-nar-9.1.x.x.nar-unpacked/NAR-INF/bundled-dependencies/ directory.
-
Extract the following three JAR files, which will have unique file names
depending on the version of the NiFi container:
- commerce-search-processors-*.jar
- hcl-cache-core-*.jar
- cf-base-*.jar
- commerce-search-processors-9.1.12.0.jar
- hcl-cache-core-9.1.12.0-20210714.164808-41.jar
- cf-base-9.1.12.0-20210623.164640-10.jar
docker cp <nifi_container_id>: opt/nifi/nifi-current/work/nar/extensions/commerce-search-processors-nar-9.1.12.0.nar-unpacked/NAR-INF/bundled-dependencies/commerce-search-processors-9.1.12.0.jar /root/libs
-
Place these JAR files within the /libs/ directory within
the root of the
commerce-custom-search-processors
project directory that was extracted from the project template commerce-custom-search-bundles-9.1.x.x.zip archive. Rename the files to remove the version numbers.Rename:- commerce-search-processors-9.1.12.0.jar to commerce-search-processors.jar
- hcl-cache-core-9.1.12.0-20210714.164808-41.jar to hcl-cache-core.jar
- cf-base-9.1.12.0-20210623.164640-10.jar to cf-base.jar
-
Update the pom.xml file in the root directory of the
commerce-custom-search-processors
project and change the file name references to the extracted JAR file names.For example:<dependency> <groupId>com.hcl.commerce</groupId> <artifactId>dummy-commerce-search-processors</artifactId> <version>9.1.12.0</version> <scope>system</scope> <systemPath>${project.basedir}/libs/commerce-search-processors.jar</systemPath></dependency>
- Import the project template as an existing Maven projects (Rational Application Developer included with the HCL Commerce toolkit, with a Maven plug-in. ) by using Eclipse, or the
-
Select the root directory for the extracted project template content.
For example, if you have extracted the project template in the c:\downloads\, then select c:\downloads\commerce-custom-search-bundles-9.1.12.0\ as a root directory.
- Click Finish and wait for the dependencies to complete downloading.