Thread Utilization When Using WebLogic Destinations Limitations for Multi-threaded Topic MDBs

Tuning Message-Driven Beans 11-3 ■ In WebLogic Server 8.1, you could increase the size of the default execute queue knowing that a larger default pool means a larger maximum MDB concurrency. Default thread pool MDBs upgraded to WebLogic Server 9.0 will have a fixed maximum of 16. To achieve MDB concurrency numbers higher than 16, you will need to create a custom work manager or custom execute queue. See Table 11–1 .

11.2.3 Thread Utilization When Using WebLogic Destinations

The following section provides information on how threads are allocated when WebLogic Server interoperates with WebLogic destinations. ■ Non-transactional WebLogic MDBs allocate threads from the thread-pool designated by the dispatch-policy as needed when there are new messages to be processed. If the MDB has successfully connected to its source destination, but there are no messages to be processed, then the MDB will use no threads. ■ Transactional WebLogic MDBs with transaction batching disabled work the same as non-transactional MDBs except for Topic MDBs with a Topic Messages Distribution Mode of Compatibility the default, in which case the MDB always limits the thread pool size to 1. ■ The behavior of transactional MDBs with transaction batching enabled depends on whether the MDB is listening on a topic or a queue: – MDBs listening on topics: — Each deployed MDB uses a dedicated daemon polling thread that is created in Non-Pooled Threads thread group. Topic Messages Distribution Mode = Compatibility: Each deployed MDB uses a dedicated daemon polling thread that is created in the Non-Pooled Threads thread group. Topic Messages Distribution Mode = One-Copy-Per-Server or One-Copy-Per-Application: Same as queues. – MDBs listening on queues — Instead of a dedicated thread, each deployed MDB uses a token-based, synchronous polling mechanism that always uses at least one thread from the dispatch-policy. See Section 11.5, Token-based Message Polling for Transactional MDBs Listening on QueuesTopics . For information on how threads are allocated when WebLogic Server interoperates with MDBs that consume from Foreign destinations, see Section 11.4.2, Thread Utilization for MDBs that Process Messages from Foreign Destinations .

11.2.4 Limitations for Multi-threaded Topic MDBs

When the topicMessagesDistributionMode is Compatibility, the default behavior for non-transactional topic MDBs is to multi-thread the message processing. In this situation, the MDB container fails to provide reproducible behavior when the topic is not a WebLogic JMS Topic, such as unexpected exceptions and acknowledgement of messages that have not yet been processed. For example, if an application throws a RuntimeException from onmessage, the container may still acknowledge the message. Oracle recommends setting max-beans-in-free-pool to a value of 1 in the deployment descriptor to prevent multi-threading in topic MDBs when the topic is a foreign vendor topic not a WebLogic JMS topic. Note: You must configure the max-threads-constraint parameter to override the default concurrency of 16. 11-4 Performance and Tuning for Oracle WebLogic Server Transactional MDBs automatically force concurrency to 1 regardless of the max-beans-in-free-pool setting.

11.3 Best Practices for Configuring and Deploying MDBs Using Distributed Topics