activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose MarĂ­a Zaragoza <>
Subject Questions about PooledConnectionFactory in AMQ 5.8
Date Tue, 19 Nov 2013 15:52:53 GMT

I'm using AMQ 5.8 and I've got some questions about PooledConnectionFactory:

This is my testing configuration , running in JVM 6

// ConnectionFactory
ActiveMQConnectionFactory connectionFactory = new

//PooledConnectionFactory  ( size 1 )
PooledConnectionFactory pooledConnectionFactory = new

Connection connection1 = pooledConnectionFactory.createConnection();
Connection connection2 = pooledConnectionFactory.createConnection();


I've checked that connection1 != connection2  , i.e., they are
different instances  , does't it make any sense ?
Pool size is 1 , so I would wait that they were the same instance


I've checked that if connection1 is started ( connection1.start() ) ,
connection2 doesn't require to execute connection2.start()
So, I guess that connection1  and connection2 share something but they
aren't "the same thing "


I've checked that connection1.stop() or connection2.stop() ( i guess
that over any PooledConnection ) don't do anything
I wonder why , though it's not a problem for me


I've checked that connection1.close() only has effect on consumers
created on connection1 , and connection2.close() only has effect on
consumers created on connection2. So, it seems they are different
But if I has got only one connection in pool, how I can close *that*
connection ? ( I don't want to close all of then with clear() method
on PooledConnectionFactory, but I want to close a single connection )

Thanks and regards

View raw message