Accounting and statistics data is
associated with an accounting origin. For more information, see Message flow statistics and accounting data and Message flow accounting and statistics accounting origin.
You
can set a different value for every message flow for which data collection
is active, or the same value for a group of message flows (for example,
those in a single integration server, or associated with a particular
client, department, or application suite).
The accounting origin
setting is not used until you deploy the message flow or flows to
the brokers on which they are to run. You can activate data collection,
or modify it to request accounting origin support, before or after
you deploy the message flow. You do not have to stop collecting data
when you deploy a message flow that changes accounting origin.
To
configure a message flow to specify a particular accounting origin,
complete the following steps.
- Open the message flow with which you want to work.
- Click Selection above the palette
of nodes.
- Right-click a Compute, Database, or Filter node in the editor view,
then click Open ESQL. The associated
ESQL file is opened in the editor view, and your cursor is positioned
at the start of the correct module. You can include the required ESQL
in any of these nodes, so decide which node in each message flow is
the most appropriate for this action.
To take advantage of the
accounting origin support, include one of these nodes in each message
flow for which you want a specific origin set. If you have not configured
one of these three nodes in the message flow, you must add one at
a suitable point (for example, immediately following the input node)
and connect it to other nodes in the flow.
- Update the ESQL in the node module to set an accounting
origin. The broker uses the origin identifier that is
set in the Environment tree. You must set a value in the field with
correlation name Environment.Broker.Accounting.Origin.
This field is not created automatically in the Environment tree when
the message is first received in the broker. The field is created
only when you set it in an ESQL module that is associated with a node
in the message flow.
If you do not set a value in the message flow,
the default value Anonymous is used for all output.
If you set a value in more than one place in the message flow, the
value that you set immediately before the message flow terminates
is used in the output data.
The code that you must add has the
following form:
SET Environment.Broker.Accounting.Origin = "value";
You
can set the identifier to a fixed value (as shown previously), or
you can determine its value based on a dynamic value that is known
only at run time. The value must be character data, and can be a maximum
of 32 bytes. For example, you might set its value to the contents
of a particular field in the message that is being processed (if you
are coding ESQL for a Compute node,
you must use correlation name InputBody in place of Body in the following
example):
IF Body.DepartmentName <> NULL THEN
SET Environment.Broker.Accounting.Origin = Body.DepartmentName;
END IF;
- Save the ESQL module, and check that you have not introduced
any errors.
- Save the message flow, and check again for errors.
You are now ready to deploy the updated
message flow; for more information, see
Deploying resources.
Accounting and statistics data records that are collected after the
message flow has been deployed includes the origin identifier that
you have set.
Now that
Environment.Broker.Accounting.Origin is set, you must enable the Accounting Origin collection function: Specify the
-b basic option in the
mqsichangeflowstats command. For more information, see
mqsichangeflowstats command.