What Happens When a Message Is Delayed During Processing? What Happens When a Filter Makes a Message Undeliverable What Happens When Destination Sort Keys are Used

10-8 Programming JMS for Oracle WebLogic Server ■ Section 10.5.5, Using Unit-of-Order with Topics ■ Section 10.5.6, Using Unit-of-Order with JMS Message Management ■ Section 10.5.7, Using Unit-of-Order with WebLogic Store-and-Forward ■ Section 10.5.8, Using Unit-of-Order with WebLogic Messaging Bridge 10.5.1 What Happens When a Message Is Delayed During Processing? There are many situations that can occur during message processing that would normally change the order in which a message is processed. The following is a short list of typical message processing states that make a message not ready for delivery: ■ A message is within an uncommitted transaction. ■ A messages TimeToDeliver value prevents it from being delivered until the TimeToDeliver interval has elapsed. ■ A consumer calls a recover or rollback that prevents a message from being re-delivered until the RedeliveryDelay interval has elapsed. Suppose messages A and B arrive respectively in the same Unit-of-Order, and message A cannot be delivered for any reason listed above. Even though nothing is delaying the delivery of message B, it is not deliverable until message A in its Unit-of-Order has been delivered.

10.5.2 What Happens When a Filter Makes a Message Undeliverable

Using a filter and a Unit-of-Order can provide unexpected behaviors. Suppose messages A through Z are in the same Unit-of-Order in the same Queue. Consumer1 has a filter, and messages A, B, and C satisfy the filter, and they are delivered to Consumer1. 1. Messages D through Z are undeliverable until messages A, B, and C are acknowledged. 2. Messages A, B, and C are acknowledged or recovered. 3. Message D is available to the message delivery system. 4. Message D does not pass the filter and can never be presented to Consumer1. 5. Messages E through Z are undeliverable until message D is processed. ■ The transaction that contains message D must be rolled back. ■ Once message D is processed, messages E through Z can be delivered. For more information, see Section 6.9, Filtering Messages.

10.5.3 What Happens When Destination Sort Keys are Used

Destination sort keys control the order in which messages are presented to consumers when messages are not part of a Unit-of-Order or are not part of the same Unit-of-Order. For example, messages A and B arrive and in the same Unit-of-Order on a queue that is sorted by priority and the sort order is depending, but message B has a higher priority than A. Even though message B has a higher priority than message A, message B is still not deliverable until message A has been processed because they are in the same Unit-of-Order. If a message C arrives and either does not have a Unit-of-Order or is Using Message Unit-of-Order 10-9 not in the same Unit-of-Order as message A, the priority setting of message C and the priority setting of message A determine the delivery order. See Configuring Basic JMS System Resources in Configuring and Managing JMS for Oracle WebLogic Server.

10.5.4 Using Unit-of-Order with Distributed Destinations