App Connect

 View Only

Deploying and Invoking a message flow containing a UDN(User Defined Node) in App Connect on CP4I/OCP

By DEEPA S posted 4 days ago

  

This article outlines the procedure for deploying and invoking a message flow that contains a user-defined node in App Connect on CP4I or the OpenShift Container Platform (OCP).

IBM App Connect Enterprise allows users to create user-defined nodes also known as custom nodes which extends the capabilities of the integration toolkit beyond the standard set of nodes provided by the platform. These nodes are developed using IBM Integration Toolkit, which provides a development environment for designing, developing, and testing integration solutions.

In this article we mainly focus on how to deploy and invoke a Java based user-defined node.

The IBM App Connect Documentation provides detailed explanations on creating a user-defined node, compiling it, testing it, and packaging it on on-prem. 

Reference - Creating a user-defined node


Now let us understand how we can deploy a message flow containing a UDN and invoke it in OCP. 

Creating a BAR file for the message flow

Note: The following application is taken from the tutorials for demonstration purposes.


The flow consists of an HTTPInput => User-Defined Node => HTTPReply:

Image of a flow
The purpose of this message flow is to read a property from a user-defined policy. To create a user-defined node, we need to create a user-defined project, a Java project, an Application, and other resources (Policy, Library etc)if needed.

In this example we have 4 projects:

  1. A User-Defined Node project named PolicyQuery.
  2. A Java project named PolicyQueryImpl.
  3. An Application named ExampleAppUsingUDN.
  4. A Policy project named ExampleUserDefinedPolicyProject.
image showing  4 projects

  • The User-Defined Node project PolicyQuery provides the files describing the toolkit part of the user-defined node. It's files provide the icons for the node and describe the names of its properties and terminals.
  • The Java project PolicyQueryImpl contains code for the implementation of the runtime of the node. The code provides getters and setters for the node properties and the main evaluate method implementation (found inside PolicyQueryNode.java).
  • The other two projects provide an example message flow (in ExampleFlowUsingUDN) and policy (in ExampleUserDefinedPolicyProject) which can be used to test the user-defined node implementation.

After creating the user-defined node, the next step is to compile it.
The steps for compiling a Java user-defined node on on-prem are explained here: Compiling a Java user-defined node

Next, we need to create a BAR file that includes the application containing the UDN, the policy project, and the .jar file generated from compiling the Java UDN in the previous step.

The contents of the BAR file are as shown below:

Contents of the BAR file
Installing user-defined extension runtime files on an integration node/server

To test the functionality of the user-defined node, you need to install the compiled runtime files for your user-defined extension on the integration node/server where you intend to perform the testing.

These are the steps to install the user-defined extension runtime file on an integration server:

  1. Go to the IBM App Connect Dashboard in OCP.
  2. Click on the Configuration option from the left-hand side menu.
  3. Click on the Create configuration button on the right-hand side.
    Configuration image
  4. For Type, select server.conf.yaml, provide a name for your configuration, and then paste the following contents into the editable section.



    

lilPath: '/home/aceuser/ace-server/run/DefaultApplication'     # A list of paths from where user-defined node LIL/JAR files are loaded. (Multiple directories are separated by platform path separator)

    Create configuration
  5. Now click on Create.

The above steps will create a configuration which will be picked by the integration server. (You need to manually select the created configuration while creating a new integration server or editing an existing one for the server to pick up this configuration). This step is explained in the later section of this article.

Note: When you deploy a BAR file that contains a JAR file, it will be located in this path - /home/aceuser/ace-server/run/DefaultApplication. 

Hence we specified the above path in lilpath, which contains the runtime file for the user-defined node.

Default Application
Deploy and invoke the message flow containing UDN

Steps to deploy and invoke a message flow containing UDN

  1. Open the App Connect Dashboard in OCP
  2. Click on Deploy Integrations, select the size of the integration server you want to create based on the requirements and click Next.
  3. Upload the BAR file to be deployed.
  4. In configurations, select the configuration we have created earlier (und-lilpath) and click Next.
  5. Click on Create and it will create the integration server pod.
  6. Now invoke the endpoint in order to trigger the flow. We can get the endpoint to be invoked from the Dashboard.
    Dashboard
  7. We get the output like below; 
    Output

Note: In case you are deploying the flow to an already existing integration server then you need to edit the properties of the server and manually add the configuration so that it will pick up the new configuration added for the UDN runtime files.

0 comments
4 views

Permalink