Search

30.3. MDB and Consumer pool size

download PDF
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
{ ....}
Red Hat logoGithubRedditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

© 2024 Red Hat, Inc.