Pooledconnectionfactory has two attribute maxconnections,maximumactive. At first glance, with human common sense, maxconnection should indicate the maximum number of connection that can be built, maximumactive should represent the maximum number of active connection, and when the number of connections in the pool is greater than the maximum active number, More than IdleTimeout will be recycled to the thread.
If this is understood, it is a big mistake. These two parameters of pooledconnetionfactory are not meant at all.
Look at the composition of the pooledconnectionfactory structure:
Note: ConnectionPool in fact, the storage is a activemqconnection , the name of the egg really hurts.
So it seems that when we set up the pooledconnection, it is advisable to have the maxconnections set to a larger size. Its default value is 1. Maximumactive can be set to a relatively small, its default value is 500, this value is too large, worried about memory overflow. Idletime conditionally can be set to a larger number, increasing the reuse time of connection, the default value is 30 seconds.
ActiveMQ Connection Pool