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.
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>
To help you create monitoring profiles, the following sample contains an outline monitoring profile XML file and the monitoring profile XML schema file (MonitoringProfile.xsd):
Validate your monitoring profiles against the XML schema to ensure that they are correct.
You can view information about samples only when you use the product documentation that is integrated with the IBM® Integration Toolkit or the online product documentation. You can run samples only when you use the product documentation that is integrated with the IBM Integration Toolkit.
The following steps describe how to create a monitoring profile XML. Follow these steps for each p:eventSource element.
Event type | Event source address |
---|---|
Transaction Start event | nodelabel.transaction.Start |
Transaction End event | nodelabel.transaction.End |
Transaction Rollback event | nodelabel.transaction.Rollback |
Terminal event | nodelabel.terminal.<Terminal> |
In the emitted event, the address string of the event source is set in the wmb:eventData/@wmb:eventSourceAddress attribute.
In the emitted event, the event name is set in the wmb:eventPointData/wmb:eventIdentity/@wmb:eventName attribute.
If p:eventName element is not supplied, @wmb:eventName in the emitted event defaults to @p:eventSourceAddress.
Using this facility, you can tailor event emissions to your business requirements, by filtering out events that do not match a set of rules. This can reduce the number of events emitted, and reduce the workload on your monitoring application.
This facility is commonly used for communicating significant business data in a business event. If the event contains the input bit stream, this facility can also be used to extract key fields, allowing another application to provide an audit trail or to resubmit failed messages.
In the emitted event, the extracted data is set in the wmb:applicationData/wmb:simpleContent and wmb:applicationData/wmb:complexContent elements.
In the emitted event, the extracted bitstream data is set in the wmb:bitstreamData/wmb:bitstream element.
Every emitted monitoring event can contain up to three correlation attributes. If no correlation information is specified in the monitoring profile, no correlation attributes will be used.
If the transaction start event is specified to be included in the message flow unit of work, but the message processing fails and this unit of work is not published, the transaction start event will be included in an independent unit of work. This ensures that your monitoring application receives a pair of events (start and rollback), rather than receiving a rollback event in isolation.
An independent transaction can be started only if the main transaction has been either committed or rolled back. If the Commit count property of the flow is greater than one, (Configurable message flow properties), or the Commit by message group property is set (Receiving messages in a WebSphere MQ message group), the events targeted for the independent transaction are instead emitted out of sync point, and a message is output stating that this has been done.
Event Type | Allowed values |
---|---|
transaction.Start |
|
transaction.End |
|
transaction.Rollback |
|
terminal |
|
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 broker 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 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).