HCL Commerce Version 9.1.10.0 or later

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.
Use the following instructions to download, extract, import the project template, and set up your project environment.
HCL Commerce Version 9.1.12.0 or laterNote: Steps 4, 5, 6 and 7 are not required after version 9.1.12.0.

Procedure

  1. Open a web browser, and go to the HCL License and Delivery portal.
  2. 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.
  3. 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
    HCL Commerce Version 9.1.12.0 or laterNote: Steps 4, 5, 6 and 7 are not required after version 9.1.12.0.
  4. 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.
  5. 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
    For example, three representative files can be named:
    • 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
    A sample Docker command for copying a jar file out of the container is:
    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
  6. 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
  7. 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>
  8. Import the project template as an existing Maven projects (File > Import > Maven > Existing Maven Projects) by using Eclipse, or the Rational Application Developer included with the HCL Commerce toolkit, with a Maven plug-in.
  9. Select the root directory for the extracted project template content.
    1. 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.

    2. Click Finish and wait for the dependencies to complete downloading.

Results

Your development environment is now ready to create custom NiFi processors.