30.3. MDB and Consumer pool size
Most application servers, including JBoss, allow you to configure how many MDBs there are in a pool. It is important to understand that the
MaxPoolSize
parameter in the ejb3-interceptors-aop.xml
file will not have an effect on how many sessions or consumers are created because the Resource Adaptor implementation is not aware of the application server MDB implementation.
For example, if you set the MDB
MaxPoolSize
to 1, 15 sessions or consumers are created (15 is the default). To limit how many sessions or consumers are created, set the maxSession
parameter on the resource adapter, or through an ActivationConfigProperty
annotation on the MDB.
@MessageDriven(name = "MDBMessageSendTxExample", activationConfig = { @ActivationConfigProperty (propertyName = "destinationType", propertyValue = "javax.jms.Queue"), @ActivationConfigProperty (propertyName = "destination", propertyValue = "queue/testQueue"), @ActivationConfigProperty (propertyName = "maxSession", propertyValue = "1") }) @TransactionManagement(value= TransactionManagementType.CONTAINER) @TransactionAttribute(value= TransactionAttributeType.REQUIRED) public class MyMDB implements MessageListener { ....}