Use the Trace node to generate trace records that you can use to monitor the behavior of a message flow.
This topic contains the following sections:
Trace records can incorporate text, message content, and date and time information, to help you to monitor the behavior of the message flow.
You can choose to write the records to the user trace file, another file, or the local error log (which contains error and information messages written by all other WebSphere® Message Broker components). If you write traces to the local error log, you can issue a message from the default message catalog that is supplied with WebSphere Message Broker, or you can create your own message catalog.
The operation of the Trace node is independent of the setting of user tracing for the message flow that contains it. In particular, records that are written by the Trace node to the user trace log are written even if user trace is not currently active for the message flow.
The Trace node is contained in the Construction drawer of the palette, and is represented in the workbench by the following icon:
Look at the following samples to see how to use this node:
You can view samples only when you use the information center that is integrated with the Message Brokers Toolkit.
Include a Trace node to help diagnose errors in your message flow. By tracing the contents of the message at various points in the flow, you can determine the sequence of processing. You can configure the Trace node to record the content of a message, and to check the action of a specific node on the message. For example, you can include a Trace node immediately after a Compute node to check that the output message has the expected format.
You can also use the Trace node to provide information in error handling within your message flows. For example, you can use this node to record failures in processing due to errors in the content or format of a message.
Remove Trace nodes from your message flow when you have tested the message flow, and have proved that its operation is correct.
When you have put an instance of the Trace node into a message flow, you can configure it; see Configuring a message flow node. The properties of the node are displayed in the Properties view. To display the properties of the node in the Properties dialog, either double-click the node, or right-click the node and click Properties. All mandatory properties for which you must enter a value (those that do not have a default value defined) are marked with an asterisk.
The terminals of the Trace node are described in the following table.
Terminal | Description |
---|---|
In | The input terminal that accepts a message for processing by the node. |
Out | The output terminal through which the message is propagated. |
The following tables describe the node properties. The column headed M indicates whether the property is mandatory (marked with an asterisk if you must enter a value when no default is defined); the column headed C indicates whether the property is configurable (you can change the value when you add the message flow to the BAR file to deploy it).
The Description properties of the Trace node are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Node name | No | No | The node type: Trace | The name of the node. |
Short Description | No | No | A brief description of the node. | |
Long Description | No | No | Text that describes the purpose of the node in the message flow. |
The Basic properties of the Trace node are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Destination | Yes | No | User Trace | The destination of the trace record that is
written by the node. The Destination refers
to the computer that hosts the broker on which the Trace node is deployed:
|
File Path | No | Yes | The fully-qualified file name of the file to which to write records. This property is valid only if Destination is set to File. | |
Pattern | No | No | The data that is to be included in the trace
record. Create an ESQL pattern to specify what information to write.
If you write the trace record to the local error log, the pattern
governs the information that is written in the text of the message
number that is selected. If you use the default message catalog, and
a number between 3051 and 3099, the pattern information
is inserted as &1 in the message text.
The pattern below illustrates some of the options that are
available. The pattern writes an initial line of text, records two
elements of the current message, and adds a simple timestamp:
Message passed through with the following fields: Store name is ${Body.storedetailselement.storename} Total sales are ${Body.totalselement.totalsales} Time is: ${EXTRACT(HOUR FROM CURRENT_TIMESTAMP)} :${EXTRACT(MINUTE FROM CURRENT_TIMESTAMP)} The
resulting trace record is:
Message passed through with the following fields: Store name is 'SRUCorporation' Total sales are '34.98' Time is: 11:19 A pattern that contains syntax errors does not prevent a message flow that contains the Trace node from deploying, but the node writes no trace records. |
|
Message Catalog | No | No | The name of the message catalog from which the
error text for the error number of the exception is extracted. The
default value (blank) indicates that the message is taken from the
message catalog that is supplied with WebSphere Message
Broker. ![]() ![]() |
|
Message Number | No | No | 3051 | The error number of the message that is written. |