Maximizing Production Stuck Messages

9-8 Programming JMS for Oracle WebLogic Server

9.6 Using Message-Driven Beans with Distributed Destinations

A message-driven bean MDB acts as a JMS message listener, which is similar to an event listener except that it receives messages instead of events. For more information on MDBs, see: ■ MDBs and Messaging Models in Oracle Fusion Middleware Programming Message-Driven Beans for Oracle WebLogic Server ■ Deploying MDBs in Oracle Fusion Middleware Programming Message-Driven Beans for Oracle WebLogic Server

9.7 Common Use Cases for Distributed Destinations

The following sections provide common use case scenarios when using distributed destinations: ■ Section 9.7.1, Maximizing Production ■ Section 9.7.2, Maximizing Availability ■ Section 9.7.3, Stuck Messages

9.7.1 Maximizing Production

To maximize message production, Oracle recommends that each member of a distributed destination be associated with a producer and a consumer. The following diagram demonstrates how to efficiently provide maximum message production and high availability using a UDD without using load balancing: Figure 9–1 Paired Producers and Consumers In this situation, UDD1 is a uniform distributed destination composed of two physical members: D1 and D2. Each physical destination has a producerconsumer pair and the effective path for a message follows the solid line from the producer through the destination member to the consumer. If you are using ordering, you should have a producer for each expected Unit-of-Order. See Section 10.5.4, Using Unit-of-Order with Distributed Destinations. Using Distributed Destinations 9-9

9.7.2 Maximizing Availability

This section provides information on how to maximize message availability.

9.7.2.1 Using Queues

Ideally, its best to pair a producer with a consumer but it is not always practical. The rate that messages are consumed is the limiting factor that determines the message throughput of your application. You can increase the availability of consumers by using load balancing between member destinations. In this situation, consumers are not paired with a producer as the UDD load balances an incoming message to the next available consumer using the assigned load balancing algorithm.

9.7.2.2 Using Topics

When using a distributed topic, every member destination will forward its messages to every other member of the distributed topic. Figure 9–2 Using Distributed Topics In this situation, UDD1 is a uniform distributed destination composed of two physical members: D1 and D2. Each physical destination has a producerconsumer pair. Each consumer receives messages sent by Producer 1 and Producer 2.

9.7.3 Stuck Messages

In this situation, a producer is sending messages to one member of a UDD but there is no consumer available to get the message. This typically happens as a producer sends a message to one of the destinations D1 and a consumer is listening for messages on another destination D2. Note: Some combinations of Unit-of-Order features can result in the starvation of competing Unit-of-Order message streams, including the under utilization of resources when the number of consumers exceed the number of in-flight messages with different Unit-of-Order names. You will need to test your applications under maximum loads to optimize your systems performance and eliminate conditions that under utilize resources. 9-10 Programming JMS for Oracle WebLogic Server Figure 9–3 Stuck Messages UDD1 is a uniform distributed destination composed of two physical members: D1 and D2. D1 has a producer and D2 has a consumer. Avoid this configuration by using producerconsumer pairs or by configuring forwarding on the destination. 10 Using Message Unit-of-Order 10-1 10 Using Message Unit-of-Order The following sections describe how to use Message Unit-of-Order to provide strict message ordering when using WebLogic JMS: ■ Section 10.1, What Is Message Unit-Of-Order? ■ Section 10.2, Understanding Message Processing with Unit-of-Order ■ Section 10.3, Message Unit-of-Order Case Study ■ Section 10.4, How to Create a Unit-of-Order ■ Section 10.5, Message Unit-of-Order Advanced Topics ■ Section 10.6, Limitations of Message Unit-of-Order 10.1 What Is Message Unit-Of-Order? Message Unit-of-Order is a WebLogic Server value-added feature that enables a stand-alone message producer, or a group of producers acting as one, to group messages into a single unit with respect to the processing order. This single unit is called a Unit-of-Order and requires that all messages from that unit be processed sequentially in the order they were created.

10.2 Understanding Message Processing with Unit-of-Order

The following sections compare message processing as described by the JMS specification with message processing enhanced by using WebLogic Servers Message Unit-of-Order feature. ■ Section 10.2.1, Message Processing According to the JMS Specification ■ Section 10.2.2, Message Processing with Unit-of-Order ■ Section 10.2.3, Message Delivery with Unit-of-Order

10.2.1 Message Processing According to the JMS Specification

While the Java Message Service Specification, at http:www.java.sun.comproductsjmsdocs.html , provides an ordered message delivery, it does so in a very strict sense. It defines order between a single instance of a producer and a single instance of a consumer, but does not take into account the following common situations: ■ Many consumers on one queue. See Chapter 9, Using Distributed Destinations.