Configuring MDB or SCA throttling for the default messaging provider
Use this task to configure the throttling of messages for message-driven beans or Service Component Architecture (SCA) composites 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 WebSphere MQ messaging provider, you configure message throttling by setting the maximum server sessions property on the WebSphere 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 or SCA composite 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 or SCA composite 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 or SCA composite is controlled by the Maximum concurrent endpoint setting in the activation specification used to deploy the message-driven bean or SCA composite. This maximum concurrency limit helps prevent a temporary build up of messages from starting too many MDB or SCA instances. By default, the maximum number of concurrent MDB or SCA instances is set to 10.
The Maximum concurrent endpoints field limits the number of endpoints (instances of a given message-driven bean or SCA composite) 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 or SCA composite 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 or SCA composite, 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 or SCA composite 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 or SCA composite. If there are multiple message-driven beans or SCA composites deployed against a single activation specification then these maximum values apply to each message-driven bean or SCA composite 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 the message-driven beans or SCA composites, which is especially important on z/OS . Workload arriving on the destination the message-driven bean or SCA composite is consuming from might use up more server resource and therefore obstruct other activities. An example of this is when restarting MDB or SCA applications you find a backlog of messages. The number of messages can be throttled so that the message-driven bean or SCA composite 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.
- Tune the maximum number of instances of a message-driven bean or SCA composite.
The maximum concurrency is set in the activation specification used to deploy the message-driven bean or SCA composite.
- 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 or SCA 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 the changes to the master configuration.
- Tune the maximum batch size for a message-driven bean or SCA composite.
By default, only a single message is delivered to a message-driven bean or SCA instance at one time. We can improve performance by batching messages to the message-driven bean or SCA composite. Each message-driven bean or SCA 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 or SCA composite 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 or SCA composite.
- Click Resources -> Resource Adapters -> J2C activation specifications -> activation_specification_name -> [Additional Properties] J2C activation specification custom properties.
- View the maxBatchSize custom property. The default value is 1. For high throughput primitive MDB or SCA 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 the changes to the master configuration.
Related concepts
Workload sharing with queue destinations
Related information:
Messaging flow for JCA MDBs on z/OS with service integration JMS activation specification [Settings]