Use the Sequence node to add a sequence number to one or more groups of input messages.
This topic contains the following sections:
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:
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.
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:
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.
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
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 |
|
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:
|
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:
|
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. |