App Connect

 View Only

Traceability options in IBM App Connect Enterprise

By Irfan Shahzad posted Thu January 04, 2024 01:57 AM

  

Traceability plays a vital role in identification and resolution of different issues within the application. If implemented correctly, traceability enables teams to quickly identify issues and address them in a timely manner. Furthermore, it is considered an important aspect of any cloud native application.

In this series, we will cover some of the options for implementing traceability within IBM App Connect Enterprise varying from options provided by IBM ACE to implementing reusable frameworks. This part of the article (Part-1) covers implementing traceability through logging using Trace Node and Log4j2, popular logging framework in Java community. Later parts of the series will cover concepts of Event Monitoring and Business Transaction Monitoring and how these IBM ACE functionalities can be used in the context of implementing traceability and logging within the enterprise applications. To get an idea of what will be covered in each part of this series, refer to the following summary. Let's get started.

  1. Part1 - Implementing traceability with Trace Node and Log4j2 logging framework integration.
  2. Part2 - Implementing traceability with Monitoring Events and Elastic Stack integration.
  3. Part3 - Implementing traceability with Business Transaction Monitoring (BTM) and database Integration.

Traceability using Trace Node:

By default, IBM ACE provides a Trace Node within Error handling group of the palette for information logging purposes. Using Basic configuration tab, you can provide whatever information you want to capture inside a Pattern field in the form of the template. Within a template, you can refer to the implicit variables surrounded by ${} to evaluate their values. You can refer to documentation of Trace Node, for details regarding different configuration parameters.  

Trace Node provided by IBM ACE for capturing information flowing through different message flows.

 

In my case, I have captured some of the events from a message flow inside a file on location specified through File path property.

Trace Node File Output

Mechanism has been built to simulate and log an exception in case there is an error while processing messages in a message flow. Furthermore, to complete the cycle, generated response has also been logged.

Trace Node - Log Exception

Exception Trace

In case you have noticed, File path properties have been promoted at the flow level to avoid defining and making changes individually on each trace node. This is considered a best practice to promote properties which needs to be defined and managed as a group within a message flow. Tip: all configurable properties can be prompted.

Promote Property

This traceability mechanism works fine when additional instances for the message flow has not been configured. In case additional instances are configured, then message flow can process and log multiple requests simultaneously and currently there is no way to corelate which response is generated against which request and exception logged against which message. Therefore, correlation id needs to be introduced for tracking complete processing cycle. Implementation has been left as an exercise for the reader.

Traceability with Log4j2 Framework:

Trace Node has certain limitations as it does not provide mechanisms for file archiving and file rotation based on size and time which is crucial in production environment. Since IBM ACE provides excellent integration with Java platform which can be leveraged to integrate frameworks designed for Java technology. One such framework is log4j2. You can check out the projects from Git Repository providing an integration layer between IBM ACE and log4j2 framework.

Repository providing Log4j2 integration artifacts

After downloading the repository, artifacts can be easily imported in IBM ACE Toolkit. Once imported, logging-java maven project can be built to generate deployment assembly for containing required jars for deployment in IBM ACE Integration Server work directory. Just provide clean package as the value for goals to be executed and click run button.

logging-java maven project build

You should see a build success message on the console and logging-java-distribution.zip file has been generated within the target folder of the project. 

logging-java-distribution archive file

This file needs to be extracted and jar files needs to be copied within shared-classes directory of IBM ACE Integration Server runtime work directory. 

log4j jars copied inside shared-classes directory

Additionally enable jvmSystemProperty property and provide the location for log4j2 configuration file within JVM section inside server.conf.yaml. Alternatively, we can create a new server.conf.yaml within overrides directory containing only properties to be overridden. Sample log4j configuration file can be obtained from logging-java\src\test\resources directory.

log4j2 configuration file location

You must update the Trace Node logging path within the Message Flow before deployment. 

Trace Node File path

Now start integration server and deploy the LoggingDemoApp. 

IBM ACE Integration Server

After deployment is successful, you can send the request to deployed http endpoint which can be easily obtained from the console log.

HTTP Request using Postman
We can verify whether file has been generated on the location specified within log4j2 configuration file and message has been logged.
Log file generated by log4j2

#AppConnect
#integration
#IBMIntegration
#IBMAPPConnect
#IBMAppConnectEnterprise
0 comments
42 views

Permalink