If you look into conf/standardjboss.xml, you'll find a section on message-driven-bean. In here you can set the MinimumSize and MaximumSize
Here's a snippet from my file:
<invoker-proxy-binding> <name>message-driven-bean</name> <invoker-mbean>default</invoker-mbean> <proxy-factory>org.jboss.ejb.plugins.jms.JMSContainerInvoker</proxy-factory> <proxy-factory-config> <JMSProviderAdapterJNDI>DefaultJMSProvider</JMSProviderAdapterJNDI> <ServerSessionPoolFactoryJNDI>StdJMSPool</ServerSessionPoolFactoryJNDI> <!-- WARN: Don't set this to zero until a bug in the pooled executor is fixed --> <MinimumSize>1</MinimumSize> <MaximumSize>15</MaximumSize> <KeepAliveMillis>30000</KeepAliveMillis> <MaxMessages>1</MaxMessages> <MDBConfig> <ReconnectIntervalSec>10</ReconnectIntervalSec> <DLQConfig> <DestinationQueue>queue/DLQ</DestinationQueue> <MaxTimesRedelivered>10</MaxTimesRedelivered> <TimeToLive>0</TimeToLive> </DLQConfig> </MDBConfig> </proxy-factory-config>
I'm pretty new to JBoss, so there may be better ways of doing this. For example, you can change these settings using the jmx-console (look under jboss.j2ee). However, changes done in jmx-console are not permanent. You're settings will return to the default when you next restart JBoss.
If anyone can add to this, that would be greatly appreciated. For example, I would like to learn more about how we determine exactly how many MDBs are running at a given time.
You mean, MDB running the onMessage() method? You can't get an active count AFAIK with JBoss. This MBean will tell you how many there were created:
You can probably expose a count by creating an MBean and calling it during the onMessage entrance and exit. Or add the feature to JBoss itself and post a patch.