Identification of Groups and Sequence IDs

Resequencing in Oracle Mediator 22-5

22.2.3 Best Effort Resequencer

The Oracle Mediator resequencer supports a best effort pattern. The following sections describe the best effort resequencer and how it processes messages.

22.2.3.1 Overview of the Best Effort Resequencer

The best effort pattern is useful for applications that produce a large number of messages in a short period of time and cannot provide information to the resequencer about the identifier to use for sequencing. Typically, the identifier used for sequencing in such scenarios is of a dateTime type or numeric type. Using the dateTime field as the sequence ID XPath enables you to control the sequencing. The messages are expected to be sent in sequence by the applications, thus the date and time the messages are sent can be used for sequencing. The Oracle Mediator makes the best effort to ensure that the messages are delivered in sequence. The best effort resequencer can reorder messages based on no knowledge about the increment of the sequence ID. This means that unlike the standard resequencer, you do not need to define the increment of the sequence ID for the best effort resequencer in advance. When the messages are processed, they are processed in sequence based on the specified sequence ID and the messages that have arrived, whether a true sequence is received. The sequence IDs are either numeric or dateTime. Therefore, sequencing occurs on the numeric order or the dateTime order of the sequence IDs.

22.2.3.1.1 Best Effort Resequencer Message Selection Strategies

The best effort resequencer processes messages asynchronously based on one of two message selection strategies: Maximum rows selected or time window. The messages selected and processed at any one time are based either on the maximum number of rows you specify or on a window of time in which they arrive. Maximum Rows Selected When the best effort resequencer is configured to use a maximum number of rows, it performs the following steps whenever new messages are available in the resequencer database: 1. The resequencer orders the messages according to the specified sequence ID typically a date and time stamp. 2. The resequencer locks and selects the number of messages equal to the value of the maxRowsRetrieved parameter from the ordered messages above. 3. The resequencer processes the selected messages one after another in its own transaction in sequence. Note: When using the FIFO resequencer, use a single-threaded inbound adapter to avoid unpredictable results. For example, when you use the fileFTP adapter, the database adapter, or the AQ adapter in front of an Oracle Mediator service component that is configured as a FIFO resequencer, configure the adapter for single-threaded processing. Otherwise, unpredictable results occur because the arrival time of each message is calculated when the message arrives to the Oracle Mediator service component instead when it arrives to the adapter service.