HCI offers several possibilities to monitor message processing. Here we will give on overview of available tools.
- Message Monitoring– provides an overview on processed messages
- Tail Log– provides access to server log file
- Message Tracing– provides access to message payload
In addition to monitoring tools, you can enhance your iflow to persist additional information for future analysis. You can achieve these using following HCI features:
- MPL Attachments– provides an API to store data in the message processing log
- Data Store– an iflow component to persist arbitrary data in the HCI database
Most of the monitoring tools are currently available in eclipse only.
Message Monitoring
Use the Message Monitoring view to check the status of recently processed messages. In case you have lot of messages you should specify a time period and/or integration flow to monitor in order to narrow down the search results.
How to Access Message Monitoring
- Open Node Explorer
- Double-click on your tenant (root node)
- Switch to the Message Monitoring view
- Specify a search filter
- Click on the ‘Search’ button
- Select a message of interest
- Check the Log for more details
Tail Log
When you search for the root cause of a message processing issue, you can check the server log for more details. Each HCI node has its own server log. since message processing only happens on IFLMAP nodes, we are only interested in the IFLMAP nodes logs. Using “Tail Log” view you can download the most recent part of the log. You can specify how big this part should be in Kilobytes.
How to Access Tail Log
- Switch to Node Explorer
- Select IFLMAP node
- Switch to or open Tail Log view (Window -> Show view -> Tail Log)
- Specify size of the log to be downloaded
- Click on Refresh
Note: By default, only errors are written to the server log. However, some components log useful information with a lower severity level. For example, you can dump SOAP request and response messages to the server log by increasing log level of org.apache.cxf.* packages to INFO.
How to dump SOAP envelopes to the log
1. In main iflow properties enable ‘Enable Debug Trace’ option
2. Open a ticket on Cloud Operations Team on component LOD-HCI-PI-OPS for changing the log level. Example:
Dear Colleagues,
Please set the log level for the following loggers:-
TMN url: https://v0XXX-tmn.avt.us1.hana.ondemand.com
Application: IFLMAP
Tenant Name: v0XXX
Logger name: org.apache.cxf.*
Set Logger Level to DEBUG
Thanks and regards,
3. Execute scenario and check log for SOAP envelopes
Message Tracing
Use message tracing when you need to access the payload of processed messages. When activated, the message tracing gathers payload and headers on each step during iflow execution. You can access this information later from the message monitoring.
When you want to use message tracing, you first need to activate it on your tenant. The following steps are required:
- Activate message tracing on your tenant via ticket to cloud ops team
- Enable tracing in your iflow
- Provide your user with authorizations to access traces
More details can be found in HCI documentation:
https://cloudintegration.hana.ondemand.com/PI/help
Designing and Managing Integration Content
- Activating Tenant and Integration Flow Tracing
How to access the message payload
- Open Message Monitoring
- Select a message
- Click on ‘View Trace’ button
- Click on a yellow envelope once the iflow gets opened
- Check message payload
MPL Attachments
HCI keeps a message processing log for every processed message. The log contains the basic information: status, error message, start/end timestamps for iflow components.
Using custom script (Groovy or Javascript) you can put additional entries into the log.
There are two possibilities:
- properties
- attachments
Properties are simple name/value pairs written into the log.
In the following example, the “payload” property contains a JSON structure:
Attachments are complete documents which are ‘attached’ to the message processing log. You can store the entire payload or other document as attachment
In the following example the same JSON payload is stored as a “weather” attachment.
Clicking on "weather" link opens an attachment viewer
Example Iflow:
write_mpl.gsh
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
def payload = message.getBody(String.class);
def messageLog = messageLogFactory.getMessageLog(message)
messageLog.setStringProperty("payload", payload)
messageLog.addAttachmentAsString("weather", payload, "application/json");
return message;
}
More details on scripting in HCI documentation:
https://cloudintegration.hana.ondemand.com/PI/help
- Designing and Managing Integration Content
- Designing Integration Content With the SAP HCI Web Application
- Configure Integration Flow Components
- Define Message Transformers
- Define Script
Data Store
Another way to persist the message payload for further analysis is to use the data store. The primary goal of the data store is to enable asynchronous message processing. You can write messages into the data store from one iflow and read them back from another one.
With some limitations you can also use the data store to persist messages for monitoring purposes.
The main limitation: if a message goes into FAILED state, no data is committed to the data store for it. For example, if you do a SOAP call in your iflow and this call fails, normally the iflow goes into FAILED state. In such case, no data will be written to the data store. Only if the iflow completes with the COMLETED state, data is committed to the database and can be accessed afterwards.
Example iflow:
You can access the data from data store in two ways
- Using another iflow with SELECT or GET operation
- Using eclipse data store viewer
How to access eclipse data store viewer
- Double-click on your tenant in Node Explorer
- Switch to “Data Store Viewer” tab
- Select the data store
- Inspect entries, use “Download Entry” context menu command to download the content
Note: your user needs the AuthGroup.BusinessExpert role on TMN application of your tenant in order to access data store entries using eclipse data store viewer. Raise ticket on LOD-HCI-PI-OPS for getting this authorization.
More details on the Data Store in HCI documentation:
https://cloudintegration.hana.ondemand.com/PI/help
- Designing and Managing Integration Content
- Defining Data Store Operations
Summary
In this blog we walked through available monitoring features of HCI. Using the out-of-the box message monitoring you can search for processed messages and check their status. In the tail log you can find additional low level information i.e. error messages or soap envelopes. Using message tracing you can access the payload of processed messages. Using MPL attachments API you can enhance the message log with additional information. Using the Data Store is another way to persist message payloads for monitoring purposes.