- Functional Demonstration
- Useful Tips
Sequencer component is used to retain the sequence of messages when a certain section of the flow has to be processed in multiple flows for performance concerns. When messages are split into parallel flows, the messages are not guaranteed to reach the end of the flow in the order of their arrival. A pair of sequencer components launched in Generate and Resequence modes respectively ensures the order is maintained.
Figure 1: Component Configuration properties
It has two options—Generate and Resequence. The first option is used to generate a sequence starting from the given Initial Sequence Number. Resequence sorts all the messages as it is stored in the sorted map. Hence, they appear in the order of their arrival. This is most useful in a Multithreaded environment.
Sequence Holder Property
The property by which the messages are compared.
Duration for which the message is retained in the component.
Interval after which resequencing is attempted.
Initial Sequence Number
Number from which sequence starts. By default, it is set to 1.
The two sequence types for Resequence Sequencer Mode are:
- Continuous: Select this to have two consecutive sequence numbers differ by 1.
- Non-Continuous: Sequence numbers are not generated continuously.
Sequence Numbering on Component Restart
The previous run count will be considered if the Continue from previous run option is chosen, else the run count is started from initial Sequence Number set in the CPS.
Number of Parallel Flows
The number of parallel flows connected to the sequencer component. The number is used to generate a property PARALLEL_FLOW_INDEX whose value is equal to Generated Sequence Number modulus the value provided here. The property PARALLEL_FLOW_INDEX is then used in the flow to set JMS selectors on routes leading to each of the parallel flows
For example, if the number of flows is '2' as seen in functional demonstration section, one route will have JMS selector as PARALLEL_FLOW_INDEX=1 and the other one will have PARALLEL_FLOW_INDEX=2.
Data base Configuration
Click the ellipsis button to configure the required database.
Figure 2: Database Configuration
This property is used when there is a need to process messages in parallel within the component, still maintaining the sequence from the external perspective.
Click the Threadpool Configuration ellipsis button to configure the Threadpool Configuration properties.
Figure 3: Threadpool Configuration
Enable Thread Pool
Enable this option to configure the properties that appear as below.
Number of requests to be processed in parallel within the component. Default value is '1'.
Batch Eviction Interval (in ms)
Time in milliseconds after which the threads are evicted in case of inactivity. New threads are created in place of evicted threads when new requests are received. Default value is '1000'.
The following figure demonstrates a skeleton use case of sequencing. The parallel flows are wrapped between sequencer and resequencer components with the number of flows set in the configuration of both sequencer and resequencer.
Filters are appropriately set on routes so that each parallel flow receives the corresponding message.
Figure 4: Sample flow
Figure 5: Output in the Display window
- Notification Interval, Resequence Interval, and Sequence Type properties appear only on selection of 'Resequence' option as Sequencer Mode.