Sequence and Re-sequence Nodes in IBM ACE
In this blog, we will learn about Sequence and re-sequence nodes in IBM ACE
Sequence Node:
The Sequence node assigns a unique sequence number to each message within an individual sequence group, based on the sequence group identifier (Group ID). This allows for sequential processing of messages in the flow.
Re-sequence Node:
The Re-sequence node reorders incoming messages to ensure they are processed in sequential order. If messages arrive out of order (e.g., sequence numbers 1, 3, 4, 2), the Re-sequence node will process the first message (sequence 1), and hold the others (3, 4) until the missing message (sequence 2) arrives. The correct sequence of messages is ensured by processing them based on their sequence numbers.
Key Properties of the Sequence Node, Re-sequence Node:
There are four properties that must be configured while configuring the Sequence node:
- Sequence Number: Adds a sequence number to each incoming message and outputs the message with the sequence number attached.
- Sequence Group Identifier: Used to determine the group to which a specific incoming message is assigned. It assists the node in grouping messages according to their content.
- Start Sequence: Defines the starting point for the sequence numbering, which can begin from any specified number (e.g., 0, 1, etc.).
- End Sequence: Specifies when the sequence for a group should end.
Ending the Sequence
There are three ways to define when a sequence ends:
- Literal: When you know how many messages are coming in, use this. You specify a fixed number, and the sequence will end after processing that many messages. This option accepts integer values.
- Predicate: Use when the number of messages is unknown, but you want the sequence to end based on a specific condition in the incoming message. This allows dynamic sequence termination based on message content.
- Automatic: Use when you’re unsure about the number of messages but want to end the sequence after a certain time. You specify the duration in seconds, and the sequence will automatically end after that time elapses.
Choosing the Right End Sequence Method
- Literal: Choose this when the number of messages to process is known. For example, if you expect exactly 5 messages in a group, you can set the sequence to end after processing those 5 messages.
- Predicate: Select this when the number of messages is unpredictable, but there is a clear condition (e.g., a field in the message) that indicates when the sequence should end.
- Automatic: Use this when you don’t know the number of messages, but you want the sequence to end based on time, such as after a certain number of seconds.
Sequence:
Input:
Output:
Re-Sequence:
Input:
API Flow:
Output: