You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by vikingbs1 <de...@chengappa.com> on 2018/01/24 09:13:48 UTC
ActiveMQPooledConnectionFactory and Caching Producers
I am using PooledConnectionFactory with JMSTemplate and want to use it
without anonymous producers. We have a custom plugin that relies on the name
of the destination to perform authorization checks and hence cannot use the
anonymous producer feature.
However, a new producer is created for every message send and I see this is
by design in PooledSession.java
public MessageProducer getMessageProducer(Destination destination) throws
JMSException {
MessageProducer result = null;
if (useAnonymousProducers) {
result = safeGetSessionHolder().getOrCreateProducer();
} else {
result = getInternalSession().createProducer(destination);
}
return result;
}
Is there a reason why producers aren't cached with PooledConnectionFactory
(when not using anonymous producers similar to CachingConnectionFactory)? In
our case we have a high throughput application and we don't want to incur
the overhead of creating producers for every message send. Thanks in
advance.
--
Sent from: http://activemq.2283324.n4.nabble.com/ActiveMQ-User-f2341805.html