Groups and Sequence IDs

22-4 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite

22.2.2 FIFO Resequencer

The FIFO resequencer supports a standard first in, first out FIFO pattern. The following sections describe the FIFO resequencer and how it processes messages.

22.2.2.1 Overview of the FIFO Resequencer

The FIFO resequencer is useful for applications that need sequencing based on the time the messages arrive to the Oracle Mediator. The FIFO resequencer receives a stream of messages that are in order and processes them in sequence for each group based on the arrival time of the messages. It is important to note that the messages to outbound services of the Oracle Mediator acting as a FIFO resequencer are guaranteed to arrive in order based on arrival time. Therefore, the messages are delivered in the order they were stored in the resequencer data store.

22.2.2.2 Information Required for FIFO Resequencing

When using the FIFO resequencer, you must always specify a group XPath expression. However, you do not need to specify a sequence ID because the messages are processed according to the time of arrival to the Oracle Mediator service component that is configured for FIFO resequencing. The group XPath expression specifies where the FIFO resequencer should find the group information in the message to group the messages. No further configuration is needed for a FIFO pattern.

22.2.2.3 Example of the FIFO Resequencer

Table 22–3 illustrates the behavior of the FIFO resequencer where msgXY,Z indicates that the message arrives as message number X to the Oracle Mediator service component and the message contains sequenceID Y and group Z. As shown in Table 22–3 , the messages are sequenced based on their time of arrival and the sequenceID is not used for sequencing. Table 22–3 FIFO Resequencer Behavior Incoming Messages Sequenced Messages msg032,c msg061,c msg075,a msg103,a msg103,c msg027,a msg059,a msg124,c msg124,c,msg103,c,msg061,c,msg032,c msg059,a, msg027,a, msg103,a, msg075,a 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.