-->

How does the MDB instance picked from a particular

2019-08-17 20:05发布

问题:

I'm wondering how the MDB instance is re-used from a particular container pool.In standardjboss.xml, the standard MDB container pool is configured. In jboss-container.xml ther are two MDB specific container-pool configuration that extends the standard MDB configuration.

There is no where in the source I could see certain MDBs are associated with a particular pool. I want to know how the few MDB instances are re-used from a particual pool and other MDB instance is used from an other MDB pool.

In standardjboss.xml, there standard MDB configuration is set.

<container-configuration>
          <container-name>Standard Message Driven Bean</container-name>
          <call-logging>false</call-logging>
          <invoker-proxy-binding-name>message-driven-bean</invoker-proxy-binding-name>
          <container-interceptors>
            <interceptor>org.jboss.ejb.plugins.ProxyFactoryFinderInterceptor</interceptor>
            <interceptor>org.jboss.ejb.plugins.LogInterceptor</interceptor>
            <interceptor>org.jboss.ejb.plugins.RunAsSecurityInterceptor</interceptor>
            <!-- CMT -->
            <interceptor transaction="Container">org.jboss.ejb.plugins.TxInterceptorCMT</interceptor>
            <interceptor transaction="Container">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
            <interceptor transaction="Container">org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor</interceptor>
            <!-- BMT -->
            <interceptor transaction="Bean">org.jboss.ejb.plugins.MessageDrivenInstanceInterceptor</interceptor>
            <interceptor transaction="Bean">org.jboss.ejb.plugins.MessageDrivenTxInterceptorBMT</interceptor>
            <interceptor transaction="Bean">org.jboss.ejb.plugins.CallValidationInterceptor</interceptor>
            <interceptor>org.jboss.resource.connectionmanager.CachedConnectionInterceptor</interceptor>
          </container-interceptors>
          <instance-pool>org.jboss.ejb.plugins.MessageDrivenInstancePool</instance-pool>
          <instance-cache></instance-cache>
          <persistence-manager></persistence-manager>
          <container-pool-conf>
            <MaximumSize>100</MaximumSize>
          </container-pool-conf>
        </container-configuration>

jboss-container.xml:

<container-configuration extends="Standard Message Driven Bean">
    <container-name>high performance</container-name>
    <container-pool-conf>
    <MaximumSize>5000</MaximumSize>
    </container-pool-conf>
</container-configuration>

<container-configuration extends="Standard Message Driven Bean">
    <container-name>Synchronized MDB</container-name>
    <container-pool-conf>
    <MaximumSize>1</MaximumSize>
    <strictMaximumSize>true</strictMaximumSize>
    </container-pool-conf>
</container-configuration>

So, it is clear that there are two MDB specific pools, how it is mapped with he MDB? That is which MDB instance will be allowed to be create "high performance" and which MDB instances will be restricted to single instance?

Help highly appreciated as I have spend some time figuring this out. Thank you!