Configure MDB throttling for the default messaging provider
Configure the throttling of messages for message-driven bean that we have deployed as JCA 1.5 resources on the default messaging provider.
The throttling support described in this topic only applies to the default messaging provider (the service integration JMS Resource Adapter).
For the IBM MQ messaging provider, we configure message throttling by setting the maximum server sessions property on the IBM MQ messaging provider activation specifications panel, or the maxPoolSize property when using the createWMQActivationSpec or modifyWMQActivationSpec wsadmin commands.
If we have a third-party JCA 1.5-compliant JMS messaging provider, refer to the generic method of message throttling described in Throttling inbound message flow for JCA 1.5 message-driven beans.
Use this task to throttle messages for a message-driven bean deployed as a J2EE Connector Architecture (JCA) 1.5 resource on the default messaging JMS provider.
The default messaging provider (the service integration JMS Resource Adapter) uses a special type of message throttling. We can leave the message-driven bean pools to the default size of 500.
The default messaging provider enables the throttling of message delivery to a message-driven bean through the Maximum concurrent endpoints configuration option on the JMS activation specification used to deploy the bean or composite.
- The maximum number of instances of each message-driven bean is controlled by the Maximum concurrent endpoint setting in the activation specification used to deploy the message-driven bean. This maximum concurrency limit helps prevent a temporary build up of messages from starting too many DB instances. By default, the maximum number of concurrent MDB instances is set to 10.
The aximum concurrent endpoints field limits the number of endpoints (instances of a given message-driven bean) that process messages concurrently. If the maximum has been reached, new messages are not accepted from the messaging engine for delivery until an endpoint finishes its current processing.
If the available message count (queue depth) associated with a message-driven bean is frequently high, and if the server can handle more concurrent work, we can benefit from increasing the maximum concurrency setting.
If we set the maximum concurrency for a message-driven bean, be sure specified a value smaller than the maximum number of endpoint instances that can be created by the adapter that the message-driven bean is bound to. If necessary, increase the endpoint instance limit.
- An activation specification also has a Maximum batch size that refers to how many messages can be allocated to an endpoint in one batch for serial delivery. So, for example, if we have set the Maximum concurrent endpoints property to 10 and the Maximum batch Size property to 3, then there can be up to 10 endpoints each processing up to 3 messages giving a total of 30 messages allocated to that message-driven bean. If there are multiple message-driven beans deployed against a single activation specification then these maximum values apply to each message-driven bean individually.
- Take care to ensure that you always set the Maximum concurrent endpoints property is always less than the JCA pool size.
We might want to tune the throttling of our message-driven beans, which is especially important on z/OS . Workload arriving on the destination the message-driven bean is consuming from might use up more server resource and therefore obstruct other activities. An example of this is when restarting MDB applications you find a backlog of messages. The number of messages can be throttled so that the message-driven bean can process them in the most efficient manner.
To configure the message throttling support of the default messaging provider (the service integration bus JMS Resource Adapter), use the administrative console to complete the following steps.
Tasks
- Tune the maximum number of instances of a message-driven bean.
The maximum concurrency is set in the activation specification used to deploy the message-driven bean.
- Click Resources -> Resource Adapters -> J2C activation specifications -> activation_specification_name -> [Additional Properties] J2C activation specification custom properties.
- View the maxConcurrency custom property. The default is value is 10. For high throughput primitive MDB tests, 40 was found to be an optimal value.
- Optional: To change the maxConcurrency setting, click the value field. This displays a panel for you to type a new value. In the Value field, type the new value then click OK. Save our changes to the master configuration.
- Tune the maximum batch size for a message-driven bean.
By default, only a single message is delivered to a message-driven bean instance at one time. We can improve performance by batching messages to the message-driven bean. Each message-driven bean instance then receives a number (between 1 and the batch size) of messages at a time. A change in the maximum concurrency is likely to be beneficial if the available message count (queue depth) associated with the message-driven bean is frequently high. For more information about the available message count, see View the Available Message Count on a destination. The maximum batch size is set in the activation specification used to deploy the message-driven bean.
- Click Resources -> Resource Adapters -> J2C activation specifications -> activation_specification_name -> [Additional Properties] J2C activation specification custom properties.
- View the maxBatchSize custom property. The default is 1. For high throughput primitive DB tests, 5 was found to be optimal value (providing a 20 per cent gain over batch size 1).
- Optional: To change the maxBatchSize setting, click the value field. This displays a panel for you to type a new value. In the Value field, type the new value then click OK. Save our changes to the master configuration.
Related:
Workload sharing with queue destinations (ZOS) Messaging flow for JCA MDBs on z/OS with service integration JMS activation specification [Settings]