Resequence node
Use the Resequence node to control the sequence in which a group (or groups) of incoming messages are propagated in a message flow.
- Developer
- Application Integration Suite
- Standard
- Advanced
Information about the state of in-flight messages is held on storage queues that are controlled by WebSphere® MQ, so you must install WebSphere MQ on the same computer as your integration node if you want to use the capabilities provided by the Resequence node. The storage queues that hold the state information are owned by the queue manager that is associated with the integration node, and you specify this queue manager by using the -q property of the mqsicreatebroker command. For more information about the queues that are required by the Resequence node, see Configuring the storage of events for Resequence nodes.
This topic contains the following sections:
Purpose
The Resequence node controls the sequence in which a group (or groups) of incoming messages are propagated through the node in a message flow.
You can use a Resequence node to rearrange groups of messages into sequential order according to a sequence number in the message. If the retry mechanism is Infinite (the default value), each message must contain a sequence number, which can be any positive or negative integer. If the retry mechanism is Failure, the sequence number can be omitted; see Retry mechanism, later in this topic. The sequence number is calculated by an XPath expression defined in the Path to sequence number property on the node, and it can be one that was added to the message by a Sequence node.
The Resequence node can reorder multiple sequence groups independently of each other, but it cannot reorder messages between sequence groups. The group to which a message belongs is determined by the properties of the Resequence node.
Each sequence group can be associated with only one Resequence node. Multiple Resequence 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 Resequence 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.
You can configure a Resequence node to use multiple threads for propagating messages, but only if each message that is being propagated belongs to a different sequence group. For messages belonging to the same sequence group, only one thread at a time can be used to propagate messages. As a result, the sequential order of messages in a sequence group is preserved, but no order between groups is maintained.
A transaction break occurs at the Resequence node. Messages arriving at the node are not directly propagated to the output terminal; all messages (including the next message in the sequence) are initially serialized to an internal WebSphere MQ queue. The storing of the message occurs in the current transaction; when it has been stored, the transaction is completed. If a stored message is the next one in the sequence, it is propagated down the message flow under a new transaction. Only the serializable part of the data is propagated from the node; local environment, environment, and exception lists are not preserved.
If the retry mechanism is Infinite, any exceptions that occur in nodes following the Resequence node are rolled back to the Catch terminal of the Resequence node. If the Catch terminal is not connected to any other nodes, the messages are re-delivered to the original terminal (Out, Missing, or Expired). The messages are never backed-out or discarded. If the retry mechanism is Failure, see Retry mechanism, later in this topic.
- Ensure that the controlling applications send only a finite amount of work at a time, which the message flow can manage.
- Configure additional instances so that the second part of the message flow has more instances to do work with on. Use the properties on the Instances tab to give the Resequence node its own set of additional instances.
- Structure the message flow so that the part of the flow that places the most demands on the CPU (transformation, for example), comes before the Resequence node.
- If the large workload is transient, increase the maximum queue depth on the internal queues.
- Use the Resequence configurable service to partition the queues. This can prevent the situation in which an instance of the Resequence node fills up the queues and stops another instance working.
For information about the various states and state transitions of the Resequence node, see Resequence node state machines.
The Resequence node is contained in the Routing drawer of the palette, and is represented in the IBM® Integration Toolkit by the following icon:
Using the Resequence node in a message flow
For more information about how to configure this node, see Configuring the Resequence node.
Terminals and properties
The terminals of the Resequence 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 incoming message
is routed in the following situations:
|
Out | The output terminal to which the output message is propagated by default. |
Expire | The output terminal to which the message is routed if a timeout occurs while the node is waiting for the message to arrive. All subsequent messages in the same group are also propagated to this terminal. |
Missing | The output terminal to which the missing message (which caused a timeout to occur) is routed if it subsequently arrives at the node. |
Catch | The output terminal to which the message is routed if an exception is issued downstream and caught by this node. Exceptions are caught only if this terminal is attached. |
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 Resequence node are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Node name | No | No | Resequence | 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 Resequence node are described in the following table.
Property | M | C | Default | Description |
---|---|---|---|---|
Path to sequence number | Yes | No | An XPath expression that calculates the sequence number of the message. | |
Path to sequence group identifier | No | No | An XPath expression that calculates 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 | Literal, 0 | Specifies the first sequence number in each
group. Valid values are:
|
End of sequence definition | Yes | No | Automatic | Specifies when each sequence group has been
completed. Valid values are:
|
Missing message timeout (seconds) | No | No | Specifies how long (in seconds) the node waits for the next message in the sequence before it moves on to the following one. This property is overridden by the Missing message timeout property, if set, in the Resequence configurable service. |
Property | M | C | Default | Description |
---|---|---|---|---|
Persistence mode | Yes | No | Non-persistent | Specifies whether to store incomplete sequences
of messages persistently. Valid options are:
|
Configurable service | No | Yes | None set | This property specifies the name of a Resequence
configurable service to be used by the Resequence node. The properties set by the Resequence configurable service override the equivalent properties set on the Resequence node. For more information about the properties than you can set with this configurable service, see Configurable services properties. |
Property | M | C | Default | Description |
---|---|---|---|---|
Retry mechanism | Yes | No | Infinite | Specifies how the Resequence node handles
a flow failure. Valid options are as follows:
If the Failure option is selected, behavior is as follows:
|
Property | M | C | Default | Description |
---|---|---|---|---|
Additional instances pool | No | Yes | Use Pool Associated with Message Flow | The pool from which additional instances are
obtained.
|
Additional instances | No | Yes | 0 | The number of additional instances that the node can start if the Additional instances pool property is set to Use Pool Associated with Node. |
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 by using monitoring properties for details. You can enable and disable events that are shown here by selecting or clearing the Enabled check box. |