Hi there,

I am experimenting with a Pooled Connection Factory - but I don't see any
performance gain (even worse: using PooledConnectionFactory is slower than
ActiveMQConnectionFactory).

What I do: Sending a few 100.000 messages in several threads (using
CompletableFuture). Ond run with a ActiveMQConnectionFactory, the other
with PooledConnectionFactory:

1st Run:
ConnectionFactory cf = new
ActiveMQConnectionFactory("tcp://localhost:61616");
Connection connection = cf.createConnection();
connection.start();
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
producer = session.createProducer(null);
final Topic topic = session.createTopic(topicName);
final ObjectMessage message = session.createObjectMessage(myObject);
producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
producer.send(topic, message);

2nd Run:
PooledConnectionFactory pcf = new
PooledConnectionFactory("tcp://localhost:61616");
pcf.setMaxConnections(8);
Connection connection = pcf.createConnection();
connection.start();
...

Am I setting up the PooledConnectionFactory the wrong way? Am I missing
something?

Reply via email to