Monitoring profile
To customize events after a message flow has been deployed, but without redeploying the flow, use a monitoring profile configurable service. By using this service, you can apply a monitoring profile to one or more message flows.
Install_root/server/sample/RecordReplay/MonitoringProfile.xsd
Install_root/server/sample/RecordReplay/basicMonitoringProfile.xml
Outline monitoring profile
Here is an outline monitoring profile that contains a single event source to illustrate the structure:
<p:monitoringProfile
xmlns:p="http://www.ibm.com/xmlns/prod/websphere/messagebroker/6.1.0.3/monitoring/profile" p:version="2.0">
<p:eventSource p:enabled="true" p:eventSourceAddress="SOAPInput.transaction.Start">
<p:eventPointDataQuery>
<p:eventIdentity>
<p:eventName p:literal="" p:queryText=""/>
</p:eventIdentity>
<p:eventCorrelation>
<p:localTransactionId p:queryText="" p:sourceOfId="automatic"/>
<p:parentTransactionId p:queryText="" p:sourceOfId="automatic"/>
<p:globalTransactionId p:queryText="" p:sourceOfId="automatic"/>
</p:eventCorrelation>
<p:eventFilter p:queryText="true()"/>
<p:eventUOW p:unitOfWork="messageFlow" />
</p:eventPointDataQuery>
<p:applicationDataQuery>
<p:simpleContent p:dataType="boolean" p:name="" p:targetNamespace="">
<p:valueQuery p:queryText=""/>
</p:simpleContent>
<p:complexContent p:name="" targetNamespace="">
<p:payloadQuery p:queryText=""/>
</p:complexContent>
</p:applicationDataQuery>
<p:bitstreamDataQuery p:bitstreamContent="all" p:encoding="base64Binary"/>
</p:eventSource>
</p:monitoringProfile>
p:monitoringProfile
.
It contains one or more p:eventSource
elements,
each of which specifies an event source and defines its properties.
Each p:eventSource
element contains:- A
p:eventPointDataQuery
element that provides key information about the event. - Optional: A
p:applicationDataQuery
element if the event payload will include data fields extracted from a message. - Optional: A
p:bitstreamDataQuery
element if the event payload will include bitstream data from a message.
Creating a monitoring profile
For instructions about how to create a monitoring profile XML, see Creating a monitoring profile.
XPath queries and XML namespaces
If an XPath query contains a component that has an XML namespace, the XPath contains a namespace prefix for the namespace. For example, the following XPath refers to components in two different namespaces:
<p:localTransactionId p:sourceOfId="query" p:queryText="$Body/soapenv:Header/wsa:messageID" />
For the integration node to resolve the namespace prefix, the namespace URL must also be provided. Supply a prefix mapping element for each namespace:
<p:localTransactionId p:sourceOfId="query" p:queryText="$Body/soapenv:Header/wsa:messageID">
<p:prefixMapping p:prefix="soapenv" p:URI="http://www.w3.org/2003/05/soap-envelope" />
<p:prefixMapping p:prefix="wsa" p:URI="http://www.w3.org/2005/08/addressing" />
</p:localTransactionId>
Monitoring profile examples
The following XML documents conform to the monitoring profile schemaMonitoring profile 1: Two event sources, each supplying an event name
<p:monitoringProfile
xmlns:p="http://www.ibm.com/xmlns/prod/websphere/messagebroker/6.1.0.3/monitoring/profile" p:version="2.0">
<p:eventSource p:eventSourceAddress="SOAPInput.transaction.Start">
<p:eventPointDataQuery>
<p:eventIdentity>
<p:eventName p:literal="SOAP start event"/>
</p:eventIdentity>
</p:eventPointDataQuery>
</p:eventSource>
<p:eventSource p:eventSourceAddress="SOAPInput.transaction.End">
<p:eventPointDataQuery>
<p:eventIdentity>
<p:eventName p:literal="SOAP end event"/>
</p:eventIdentity>
</p:eventPointDataQuery>
</p:eventSource>
</p:monitoringProfile>
<p:monitoringProfile
xmlns:p="http://www.ibm.com/xmlns/prod/websphere/messagebroker/6.1.0.3/monitoring/profile" p:version="2.0">
<p:eventSource p:eventSourceAddress="SOAPInput.transaction.Start">
<p:eventPointDataQuery>
<p:eventCorrelation>
<p:localTransactionId p:queryText="$Body/soapenv:Header/wsa:messageID" p:sourceOfId="query">
<p:prefixMapping p:prefix="soapenv" p:URI="http://www.w3.org/2003/05/soap-envelope"/>
<p:prefixMapping p:prefix="wsa" p:URI="http://www.w3.org/2005/08/addressing"/>
</p:localTransactionId>
</p:eventCorrelation>
</p:eventPointDataQuery>
</p:eventSource>
</p:monitoringProfile>
<p:monitoringProfile
xmlns:p="http://www.ibm.com/xmlns/prod/websphere/messagebroker/6.1.0.3/monitoring/profile" p:version="2.0">
<p:eventSource p:eventSourceAddress="MQInput.terminal.out">
<p:applicationDataQuery>
<p:simpleContent p:dataType="integer" p:name="InvoiceNumber">
<p:valueQuery p:queryText="$Body/invoice/invoiceNo"/>
</p:simpleContent>
<p:simpleContent p:dataType="string" p:name="BatchID">
<p:valueQuery p:queryText="$Body/batch/batchNo"/>
</p:simpleContent>
</p:applicationDataQuery>
</p:eventSource>
</p:monitoringProfile>
<p:monitoringProfile
xmlns:p="http://www.ibm.com/xmlns/prod/websphere/messagebroker/6.1.0.3/monitoring/profile" p:version="2.0">
<p:eventSource p:eventSourceAddress="MQInput.terminal.out">
<p:bitstreamDataQuery p:bitstreamContent="body" p:encoding="CDATA"/>
</p:eventSource>
</p:monitoringProfile>
CDATA encoding is not suitable for all types of
data. Use CDATA only when @p:bitstreamContent="body"
.
Do not use CDATA if your message bitstreams might contain
characters that are not allowed in XML (see http://www.w3.org/TR/2006/REC-xml-20060816/#charsets).