Setting message flow accounting and statistics accounting origin

You can request accounting origin support for the collection of message flow accounting and statistics data, by setting properties in the configuration file for your integration node (node.conf.yaml) or integration server (server.conf.yaml). You must also configure your message flows to provide the correct identification values that indicate what the data is associated with.

Before you begin

About this task

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 integration nodes 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.

Procedure

  1. Open the message flow with which you want to work.
  2. Click Selection above the palette of nodes.
  3. 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.

  4. Update the ESQL in the node module to set an accounting origin.
    The integration node 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 integration node. 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;
  5. Save the ESQL module, and check that you have not introduced any errors.
  6. Save the message flow, and check again for errors.
  7. Now that Environment.Broker.Accounting.Origin is set, you must enable the Accounting Origin collection function by setting the accountingOrigin property in the .yaml configuration file for your integration node or integration server.
    1. Open the node.conf.yaml or server.conf.yaml configuration file for your integration node or integration server by using a YAML editor.

      If you do not have access to a YAML editor, you can edit the file by using a plain text editor; however, you must ensure that you do not include any tab characters, because they are not valid characters in YAML files and would cause your integration server configuration to fail. If you are using a plain text editor, ensure that you use a YAML validation tool to validate the content of your file.

    2. In the Statistics section of the .yaml configuration file, set the accountingOrigin property to basic.
    3. Restart the integration server for the changes to take effect.
      For information about how to start an integration server, see Starting an integration server.

Results

You are now ready to deploy the updated message flow; for more information, see Deployment rules and guidelines. Accounting and statistics data records that are collected after the message flow has been deployed includes the origin identifier that you have set.