IBM Integration Bus, Version 9.0.0.8 Operating Systems: AIX, HP-Itanium, Linux, Solaris, Windows, z/OS

See information about the latest product version

Sequence node

Use the Sequence node to add a sequence number to one or more groups of input messages.

This topic contains the following sections:

Purpose

The Sequence node enables you to receive groups of messages from an input source, and preserve the order in which the messages in each group arrived.

Use a Sequence node to generate a monotonically increasing sequence number for each sequence group. As each message in the group arrives at the Sequence node, the sequence number for the group is incremented and stored with the message in a location specified by the node property Path to store sequence number (for example, LocalEnvironment, MQRFH2 header, message body).

The sequencing applies to messages within the same sequence group only. You can use properties in the Sequence node to organize messages into groups according to a specified condition; for example, grouping all messages with the same value in a customer number field in the message. If no sequence group is specified, a single default group is used for all messages.

A Sequence node can receive input from multiple input nodes in the message flow or from input nodes that have additional instances. The Sequence node can process multiple sequence groups in parallel, but it processes only one request at a time for sequence numbers from the same sequence group.

The Sequence node allocates a sequence number to each message in a sequence group, and the next sequence number in the group is not allocated until the current message in the group has finished processing (either by being committed or rolled back). Only one thread at a time can process messages in the same sequence group downstream of the Sequence node, which ensures that sequencing is maintained for the group when there are multiple threads in the message flow.

When the Sequence node receives messages from multiple threads, the order in which the messages reach the Sequence node is preserved. However, the order in which the messages arrive at the Sequence node might be different from the order in which they are taken from the transport by the input node. This situation can occur because messages on one thread might be overtaken by messages on other threads between the input node and Sequence node.

Each sequence group can be associated with only one Sequence node. Multiple Sequence nodes can have a sequence group with the same name, but each of those sequence groups is treated as a separate group. The combination of the integration server name, message flow name, node name, and sequence group name is used to differentiate between the sequence groups.

For example, you might have a message flow called flow1 containing a Sequence node called node1, which is deployed to an integration server called eg1. A message is sent to it using a sequence group called group1. The result is eg1/flow1/node1/group1. Exactly the same message flow in a different integration server, for example eg2, would result in eg2/flow1/node1/group1.

The Sequence node is contained in the Routing drawer of the palette, and is represented in the IBM® Integration Toolkit by the following icon:

Sequence node icon

Using the Sequence node in a message flow

Look at the following sample to see how to use the Sequence node:

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.

Configuring the Sequence node

When you have put an instance of the Sequence 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.

All mandatory properties that do not have a default value defined are marked with an asterisk.

Configure the Sequence node:

  1. Optional: On the Description tab, enter a Short description, a Long description, or both. You can also rename the node on this tab.
  2. On the Basic tab, set the properties that determine how the message sequence is controlled.
    • Use the Path to store sequence number property to specify the location in which to save the sequence number of the message. The location is specified as an XPath expression.
    • Use the Path to sequence group identifier property to specify the location of the sequence group identifier. The location is specified as an XPath expression. Messages that have the same group identifier are considered part of the same sequence group.
    • Use the Start of sequence definition property to specify the first sequence number in each group. In the Literal field, specify any positive or negative numeric value as the first sequence number in the group. The default value is 0.

      When the first message of a specific sequence group is propagated by the Sequence node, the specified starting sequence number is used to assign the first sequence number; successive messages contain monotonically increasing sequence numbers. This value is overridden by the LocalEnvironment.Sequence.StartOfSequenceNumber variable.

    • Use the End of sequence definition property to specify when each sequence group has been completed.
      • Select Literal to specify a literal sequence number. This value can be any positive or negative numeric value that is greater than the value of the Start of sequence definition property. When the message with the specified sequence number arrives, the sequence group is closed.
      • Select Predicate to specify an XPath expression that evaluates to either True or False, indicating whether the message is the last in the sequence. When the first message in the sequence has been determined, messages for that sequence group continue to have sequence numbers assigned to them until the end of sequence predicate evaluates to True.

        If the XPath expression is valid but is not present in the message, it evaluates to False and the next message in the sequence group is assigned a sequence number. When the predicate evaluates to True, the message becomes the last in the sequence and no more messages are assigned to the sequence for that sequence group.

        If the XPath expression is invalid, it fails and the message rolls back

      • Select Automatic to specify the timeout period for the node. This option specifies how long (in seconds) the node waits for messages to arrive in an empty queue, before closing the sequence group. This option is useful for applications that cannot determine the final number in the sequence. The timer starts when there are no messages in the queue waiting to be propagated. If new messages arrive before the timeout period is reached, the timer is canceled. If no new messages arrive before the end of the specified time, the sequence group is closed and any further messages for the group are considered part of a new group.
  3. On the Advanced tab:
    • Use the Persistence mode property to specify whether to store sequence group state persistently. The default value is Non-persistent.

Terminals and properties

The terminals of the Sequence node are described in the following table.

Terminal Description
In The input terminal through which the incoming message assembly arrives at the node.
Failure The output terminal to which the message is routed if an error occurs. This value includes failures caused by retry processing.
Out The output terminal to which the output message is propagated by default.

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 for deployment).

The Description properties of the Sequence node are described in the following table.

Property M C Default Description
Node name No No Sequence 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 Sequence node are described in the following table.

Property M C Default Description
Path to store sequence number No No
$OutputLocalEnvironment/
Sequence/Number
An XPath expression that specifies the location in which to save the sequence number of the message.
Path to sequence group identifier No No Not set An XPath expression that points to the location of the sequence group identifier. Messages that have the same group identifier are considered part of the same sequence group. This property functions in the same way as the Correlation path property in the Collector node.
Start of sequence definition Yes No 0 Specifies the first sequence number in each group. Valid values are positive or negative integers. The default value is 0.
End of sequence definition Yes No Automatic Specifies when each sequence group has been completed. Valid values are:
  • Literal and number
  • Predicate and XPath
  • Automatic and time in seconds
The default is Automatic.

The Advanced properties of the Sequence node are described in the following table.

Property M C Default Description
Persistence mode Yes No Non-persistent Specifies whether to store sequence group state persistently. Valid options are:
  • Non-persistent
  • Persistent
The Monitoring properties of the node are described in the following table.
Property M C Default Description
Events No No None Events that you have defined for the node are displayed on this tab. By default, no monitoring events are defined on any node in a message flow. Use Add, Edit, and Delete to create, change or delete monitoring events for the node; see Configuring monitoring event sources using monitoring properties for details.

You can enable and disable events that are shown here by selecting or clearing the Enabled check box.


bc28010_.htm | Last updated Friday, 21 July 2017