WebSphere WebSphere Enterprise Service Bus, Version 6.0 Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Message Logger mediation primitive

Use the Message Logger mediation primitive to store messages in a database.

Introduction

The Message Logger mediation primitive stores messages in a database, during a mediation flow. The Message Logger mediation primitive logs messages to a relational database using an IBM-defined database schema, it does not write to other storage mediums such as flat files.

The Message Logger mediation primitive logs an XML transcoded copy of the SMO. The default behavior is to log just the payload but the mediation primitive can be configured to log the complete SMO, or a part of the SMO defined by an XPath expression. Along with the message contents the mediation primitive also logs a timestamp, the message identifier, the primitive instance name, the mediation module instance name and the SMO version number.

The message that is logged is stored in a database column called: Message. The other data that is logged is stored in columns with an appropriate heading, as documented later in this topic.

The Message Logger mediation primitive has one input terminal and two output terminals. One output terminal is for successful output and one for failure output. The input terminal is wired to accept a message and the output terminals are wired to propagate a message. The input message triggers logging to a database and if the logging is successful then the successful output terminal propagates the original message. If an exception occurs during the processing of the input message, then the fail terminal propagates the original message, together with any exception information.

Usage

You can use the Message Logger mediation primitive to store messages that you process later. The logged messages can be used for various purposes. For example, you could use the logged messages for data mining or for auditing.

Logging the data as XML means that it can be processed by any XML-aware application. Many databases, including DB2, provide built-in capabilities to handle XML contained in a database column.

The default installation of the runtime product creates a standalone application server, and a Cloudscape database and datasource. The Message Logger mediation primitive is configured to use this Cloudscape database, by default. During a custom install of the runtime product you can choose whether to create a Cloudscape database and datasource. The runtime product also provides a script, called createMessageLoggerResource.jacl, that creates a Cloudscape database.

Properties

Data source name
The JNDI name of the datasource that defines where the data will be logged.
Root
An XPath 1.0 expression representing the scope of the message to be logged. You can specify: /, /body, /headers, or your own XPath expression. / refers to the complete SMO, /body refers to the body section of the SMO, /headers refers to the headers of the SMO. If you specify your own XPath expression then the part of the SMO you specify is processed. The message to be logged is converted to XML from the point specified by Root .
Transaction mode
Defines whether to commit changes to the database within the flow’s transaction or in a new transaction. If you specify Same then the message is logged within the flow’s transaction. By default the flow is executed under a local transaction although the mediation component can be configured to run under a global transaction. If a global transaction has been specified and a failure occurs in the flow then the global transaction, including the log operation , is rolled back. If you specify New then the message is logged within its own local transaction. In this case, if a failure occurs in the flow the message logging is not rolled back.
Table 1. Message Logger mediation primitive properties
Property Valid Values Default
Data source name String jdbc/mediation/messageLog
Root String: an XPath expression representing the root of the transformation /body
Transaction mode String: Same or New Same
Table 2. Message Logger Database Table Schema
Column Name SQL Type Key Field Description
TimeStamp TIMESTAMP Y The UTC timestamp, indicating when the message was logged to the database.
MessageID VARCHAR Y The message ID, from the SMO.
MediationName VARCHAR N The name of the mediation primitive instance that logged the message.
ModuleName VARCHAR N The name of the mediation module instance that contains the Message Logger primitive.
Message CLOB N The SMO, transcoded into XML.
Version VARCHAR N The version of the logged SMO.

Considerations

Consider the following when using the Message Logger mediation primitive:

Related information
Using the Java Database Connectivity data mediator service for data access

Reference topic

Terms of Use |

Last updated: 20 Nov 2005
http://publib.boulder.ibm.com/infocenter/ws60help/index.jsp?topic=/com.ibm.wbit.help.medprim.doc\ref\rwesb_MessageLoggermediationprimitive.html

© Copyright IBM Corporation 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)